Now every since my windows 95 days, I have always wondered how the hell do you keep your OS tidy? Installing software is easy, but how does one go about getting your diskspace back without frying anything. I know its possible, but is it realy worth the time and effort? And what if you like to install tons of software to find the one app you will like? Now with my training as a windows user I eventually just to learned to give up that quest and just learned that I have about a 50/50 chance of creating a unstable OS thru uninstalling software, and that the only practicle way back from a full HD and decent performance without being a "registry" slave is to reformat.
So I got tired of windows and Linux's promise of Free computing was pretty attractive. So I went down to the Book store and bought "The RedHat Bible" that came bundled with 7.0. Playing around with that taught me the ins and outs so I eventually got a more "serious" OS: Slackware. Later I got a bit obsessive about trying to find the latest versions of the software I use every day, the slack version I was using was getting a bit dated, so i got in the bad habit of randomly installing everything from source. I ended up spending most of my computer time chasing down obsolete and conflicting libraries, no fun in that.
My past experiances taught me that I needed to learn packaging systems. Debain was great and Gentoo was terrific. This way I could upgrade, upgrade, upgrade with the dependances being updated and taken care off. Every week I could get any new package and install it if I felt like it, with little difficulty. Plus now I can uninstall stuff.. and gues what? It goes away! no lingering after effects on the OS exept for a couple stray config files here and there. I could take Samba, NFS, KDE or anything and remove it add it again, over and over again. no sweat..
I decided tto tried out RedHat newest offering.. Well RPMs are a mess. The Nvidia rpms, almost broke my OS! for crap's sake! Almost as bad as what Windows users have to deal with. (Now all in all Redhat is realy a great OS, but not really my taste. A bit "fatty". I could fix that, but I don't like gui configuration tools that much anymore and Redhat realy is all about it's blue curve stuff.)
But SLackware is still my favorite. I just like being able to have a Linux OS that just is. Nothing fancy, no weird extra directories tacked onto the filesystem. I like my Linux clean thank you, And I like to understand exactly whats going on, no suprises. Plus SLack does have a package system, well sort of. It always seemed a bit "backwards". It doesn't keep track of dependances, and the selection of packages is limited.. That is until I found out how to use it from this website. With some simple tools I can easily and quickly build my own packages from source code.. Now why would I want to do this if I can easily get them if I use a more "modern" package system like Debian or Gentoo? It's all about control, I make it how I want it. No fuss no muss. I don't have to wait for others to test out newest versions of software, plus now I have the power to "tweak" the code and add patches to software like nmap for extra functionality, but still be able to quickly and easily uninstall stuff if I don't like it. Plus I can install weird or unusual apps, that just won't ever realy have a enough user base to warrent a fully tested package from developers.
Now mind you I have only been doing this for a couple days, but I think I got the most of the bugs ironed out, so don't blame me if it don't work... My method is a bit different from the "quick and dirty method" described in the link, although it is realy about 85-90% the same..
First make a work folder in you user directory. I am drag, so I make /home/drag/work..
Now I keep all my sources from the tarballs in there until I am finished with them..
I'll assume you know the drill:
./configure
make
make install
...and know enough that you have to read the INSTALL files, and the README files for any special configurations. Sometimes you only have to do "make" as per NVIDIA's kernel driver install and other varietions are not uncommon...
but generally 80% of the time this will work. And I try to do this completely as a regular user and never as SU or root if I can help it.. (that's the main diference from the afformentioned method)
Ok I make a builds directory in my work folder. Then I'll make a usr folder in that...
Next:
export HM=/home/drag/work/builds
so I can just use $HM and don't have to type it out every time.
ok and then (genericly) all you would have to do is:
./configure --prefix=/usr
make
make install prefix=$HM/usr
that should be enough to "trick" the software into being installed the build/usr file as if it was realy the /usr/ file..
Then you just check the build/usr folder and make sure everything is ok.
But that doesn't work all of the time.
Lots of the time the "make" file wants to put something in the /etc directory or the /lib.. or wants to make sure that the user will root. etc... In order to do that you need to be root, and so the make install will fail...
But there is a solution! It's in a nifty tool called installwatch!
you just su to root and type:
installwatch -o installog make install prefix=$HM/usr
This will run the make install with all the power of root, but installwatch will keep track of all the changes the install script makes to your filesystem. That way it'll keep track of it for you so you know what exactly is going on... the -o outputs the installwatch stuff into the installog file
The output from installwatch is not realy ment to be human-readable, it is ment so that you can create very nice shell scripts that'll do the hard stuff for you. It's just that I am still working on the details and haven't had a chance to make a effective shell script yet...
so instead after checking out the log file I just:
cat installog |grep -v /home |grep -v /dev > installog2
this will make a log2 with all the important info on it, then I check out the log2 and "mv" all the files to there correct relative locations in the builds/ folder, while carefully undoing the changes done to my OS.
Now with all that done and as root I goto the /home/drag/work/build/ directory.
I checkout everything and make sure that everything is A-ok. I also do a: chown -R root.root ./*
command (remember that dot, it's very important).. and while in the /home/drag/work/build
directory I do that good'ol SLack magic:
makepkg appname.tgz
(say yes to everything, unless you know what your doing..)
this will construct the Slackware package! Now you test it. just run pkgtool and you should be able to isntall it, no prob! Run the proggy and make sure that it works. If you don't like it, just run pkgtool and uninstall it, and it's gone. You can rebuild it again with different options or just forget about it entirely.
It's actually realy easy, and only adds a 5-10 minutes of work on top of what it takes to install stuff from source code anyways.
If you get good enough you can play around with the gcc optimization flags to try to speed it up, or add other proggies to it to make a bunch of software bundled together. Also you add your config files to the fake builds/ directory so that you can reinstall it on a different computer with all your settings.
Now why should you care about this? You got your nice apt-get, and your Gentoo portage system is as slick as snot, or maybe the RPM's are just good enough? Well do to the fact that Slackware is all about keeping standards it's package managment system will probably work on any other distro, it doesn't require any special folders, exept a place to keep the config and package history files. (The only problem is that slackware native packages may or may not work on other Distro's due to dependances in the libs.)You can build your own simple packages to augment the distro's native format, plus if you are a developer or something you can make packages easily so that you can send to your freind's computer so he can try it out and test different configurations... This method isn't just for software either, what if you are trying out a new security model that requires you to change a bunch of different configurations for a bunch of different services? You can use slack's package managment to save your old stuff and save any new configurations you have made. Now you can add and change configs and switch em back and forth for any testing you need to do. Once you test the config's out and get them "right" you can impliment them easily on a bunch of servers by putting the packages up on a ftp server..
Hope somebody finds this usefull
So I got tired of windows and Linux's promise of Free computing was pretty attractive. So I went down to the Book store and bought "The RedHat Bible" that came bundled with 7.0. Playing around with that taught me the ins and outs so I eventually got a more "serious" OS: Slackware. Later I got a bit obsessive about trying to find the latest versions of the software I use every day, the slack version I was using was getting a bit dated, so i got in the bad habit of randomly installing everything from source. I ended up spending most of my computer time chasing down obsolete and conflicting libraries, no fun in that.
My past experiances taught me that I needed to learn packaging systems. Debain was great and Gentoo was terrific. This way I could upgrade, upgrade, upgrade with the dependances being updated and taken care off. Every week I could get any new package and install it if I felt like it, with little difficulty. Plus now I can uninstall stuff.. and gues what? It goes away! no lingering after effects on the OS exept for a couple stray config files here and there. I could take Samba, NFS, KDE or anything and remove it add it again, over and over again. no sweat..
I decided tto tried out RedHat newest offering.. Well RPMs are a mess. The Nvidia rpms, almost broke my OS! for crap's sake! Almost as bad as what Windows users have to deal with. (Now all in all Redhat is realy a great OS, but not really my taste. A bit "fatty". I could fix that, but I don't like gui configuration tools that much anymore and Redhat realy is all about it's blue curve stuff.)
But SLackware is still my favorite. I just like being able to have a Linux OS that just is. Nothing fancy, no weird extra directories tacked onto the filesystem. I like my Linux clean thank you, And I like to understand exactly whats going on, no suprises. Plus SLack does have a package system, well sort of. It always seemed a bit "backwards". It doesn't keep track of dependances, and the selection of packages is limited.. That is until I found out how to use it from this website. With some simple tools I can easily and quickly build my own packages from source code.. Now why would I want to do this if I can easily get them if I use a more "modern" package system like Debian or Gentoo? It's all about control, I make it how I want it. No fuss no muss. I don't have to wait for others to test out newest versions of software, plus now I have the power to "tweak" the code and add patches to software like nmap for extra functionality, but still be able to quickly and easily uninstall stuff if I don't like it. Plus I can install weird or unusual apps, that just won't ever realy have a enough user base to warrent a fully tested package from developers.
Now mind you I have only been doing this for a couple days, but I think I got the most of the bugs ironed out, so don't blame me if it don't work... My method is a bit different from the "quick and dirty method" described in the link, although it is realy about 85-90% the same..
First make a work folder in you user directory. I am drag, so I make /home/drag/work..
Now I keep all my sources from the tarballs in there until I am finished with them..
I'll assume you know the drill:
./configure
make
make install
...and know enough that you have to read the INSTALL files, and the README files for any special configurations. Sometimes you only have to do "make" as per NVIDIA's kernel driver install and other varietions are not uncommon...
but generally 80% of the time this will work. And I try to do this completely as a regular user and never as SU or root if I can help it.. (that's the main diference from the afformentioned method)
Ok I make a builds directory in my work folder. Then I'll make a usr folder in that...
Next:
export HM=/home/drag/work/builds
so I can just use $HM and don't have to type it out every time.
ok and then (genericly) all you would have to do is:
./configure --prefix=/usr
make
make install prefix=$HM/usr
that should be enough to "trick" the software into being installed the build/usr file as if it was realy the /usr/ file..
Then you just check the build/usr folder and make sure everything is ok.
But that doesn't work all of the time.
But there is a solution! It's in a nifty tool called installwatch!
you just su to root and type:
installwatch -o installog make install prefix=$HM/usr
This will run the make install with all the power of root, but installwatch will keep track of all the changes the install script makes to your filesystem. That way it'll keep track of it for you so you know what exactly is going on... the -o outputs the installwatch stuff into the installog file
The output from installwatch is not realy ment to be human-readable, it is ment so that you can create very nice shell scripts that'll do the hard stuff for you. It's just that I am still working on the details and haven't had a chance to make a effective shell script yet...
so instead after checking out the log file I just:
cat installog |grep -v /home |grep -v /dev > installog2
this will make a log2 with all the important info on it, then I check out the log2 and "mv" all the files to there correct relative locations in the builds/ folder, while carefully undoing the changes done to my OS.
Now with all that done and as root I goto the /home/drag/work/build/ directory.
I checkout everything and make sure that everything is A-ok. I also do a: chown -R root.root ./*
command (remember that dot, it's very important).. and while in the /home/drag/work/build
directory I do that good'ol SLack magic:
makepkg appname.tgz
(say yes to everything, unless you know what your doing..)
this will construct the Slackware package! Now you test it. just run pkgtool and you should be able to isntall it, no prob! Run the proggy and make sure that it works. If you don't like it, just run pkgtool and uninstall it, and it's gone. You can rebuild it again with different options or just forget about it entirely.
It's actually realy easy, and only adds a 5-10 minutes of work on top of what it takes to install stuff from source code anyways.
If you get good enough you can play around with the gcc optimization flags to try to speed it up, or add other proggies to it to make a bunch of software bundled together. Also you add your config files to the fake builds/ directory so that you can reinstall it on a different computer with all your settings.
Now why should you care about this? You got your nice apt-get, and your Gentoo portage system is as slick as snot, or maybe the RPM's are just good enough? Well do to the fact that Slackware is all about keeping standards it's package managment system will probably work on any other distro, it doesn't require any special folders, exept a place to keep the config and package history files. (The only problem is that slackware native packages may or may not work on other Distro's due to dependances in the libs.)You can build your own simple packages to augment the distro's native format, plus if you are a developer or something you can make packages easily so that you can send to your freind's computer so he can try it out and test different configurations... This method isn't just for software either, what if you are trying out a new security model that requires you to change a bunch of different configurations for a bunch of different services? You can use slack's package managment to save your old stuff and save any new configurations you have made. Now you can add and change configs and switch em back and forth for any testing you need to do. Once you test the config's out and get them "right" you can impliment them easily on a bunch of servers by putting the packages up on a ftp server..
Hope somebody finds this usefull
