LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS package management (https://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-package-management-58612/)

aes12 05-07-2003 02:28 PM

LFS package management
 
I was wondering if anyone had played around with the idea of implementing any kind of package management on thier LFS system. I'm getting ready to start on my own, and in reading the book, before I get to it, it occured to me that managing all of these packages could be somewhat of a hassle, if you were to use the system for any significant length of time.

Here's my idea:
In addition to the recommended packages, statically compile a copy of Slackware's pkgtool and checkinstall programs. When you go on to create your dynamically linked programs, use checkinstall to create a slackware package tarball. Use pkgtool to to the actual installation.

Yeah, it's an extra step, but you get the ability to easily uninstall/upgrade the packages later on...

Now, has anyone tried this? What problems am I likely to run into?

Moreover, what do you think of the idea, in general?

lfslinux 05-07-2003 03:00 PM

checkinstall works yes. I myself use a different method that doesn't require any additional programs. The only required programs are find and sed which are present on most any Linux system.

The method is simplicity in itself: before installing a package take note of the current time on the system then use 'find' and tel lit to return all files whose status was changed after the noted timestamp you took earlier. This will return a list of all new and modified files.

The only drawback is that this method takes some time because it needs to scan every file on the filesystem. This might take a while on slow harddrives.

The script I use can be found at http://linuxfromscratch.org/~gerard/log-install

Another method could be using a program like "strace" or "checkinstall" which can be told to intercept system calls relating to file creation and writing. This is a faster method since it only scans what a process like "make install" actually does in real-time, instead of scanning the entire filesystem afterwards to see what it has done.

There are many other forms of package management that people have implemented. I suggest using the LFS search engine at http://search.linuxfromscratch.org and look around some yourself.

Lastly, go to http://hints.linuxfromscratch.org/hints.shtml and look for the "package management" section. It has a number of examples there too

MasterC 05-07-2003 09:26 PM

Gerard didn't mention why his way might work a little better than checkinstall at times...

By scanning for the changes rather than using "checkinstall" you can use some of the bundled installers (./install.sh) and such and not have to worry about editing the script (if even possible). It's more of a "works all the time" thing than checkinstall.

I personally use checkinstall and run into this problem more and more frequently now; I might give Mr Beekmans' script a go...

Cool

lfslinux 05-07-2003 09:35 PM

In that case I recomment going with "strace". strace can be used to prepend to anything that runs, including those install.sh scripts and what not.

The only reason my own script doesn't use strace is that I haven't found the time to upgrade yet. The 'find' method is very reliable and works flawlessly (for me anyways, I haven't noticed any bugs) but it's slow due to full filesystem scans. I'll get around to upgrading to strace one of these days...

CragStar 05-09-2003 09:46 AM

I use install-log from the hints section at LFS. For me it was the first thing I looked at and saw it wasn't too difficult to setup and mantain so decided to use it. Haven't used any of the others, but I think i does the job just grand!

If nothing else I just like to remember the versions of software I have installed rather than the files themselves as I hardly remove things because I only install something if I need it. So install-log is great for that as it is not too slow after the first time you use it. Plus you can choose which directories you want it to search.


All times are GMT -5. The time now is 01:02 PM.