This blog has moved! Redirecting...
You should be automatically redirected. If not, visit and update your bookmarks.

Thursday, April 20, 2006

Installing RPMs as a regular user

A while back I needed some packages on a machine that I don't have admin rights to. Grabbing the source and recompiling would have been a pain the a** so I decided to read the rpm man pages and look for a way to install packages in the user home directory. Since it's such a nice package manager, it comes with options that allows me to do just that. The command needed is:

$ rpm -ivh --relocate OLDPATH1=NEWPATH1 [--relocate OLDPATH2=NEWPATH2 ...] --badreloc package.rpm

where OLDPATH is the path in the package; and NEWPATH is something like /home/user/userroot/usr, etc.

It's best to run

$ rpm -qpl package.rpm

to see exactly which paths are going to be used by the package. For example, if the package foo.rpm produces:

$ rpm -qpl foo.rpm

then the steps needed are:

$ mkdir -p ~/myroot/usr/bin ~/myroot/usr/lib ~/myroot/usr/share/doc
$ rpm -ivh --relocate /usr=/home/$USER/myroot/usr --badreloc foo.rpm

That'll install the package under the hierarchy ~/myroot. There will some errors from rpmdb but this is fine since the rpmdb is in a filesystem that we do not have write access to. The only repercussion is that rpm will have no record of the package foo being installed (so packages will have to be removed by hand); but that's okay since we cannot possibly mess up the system while installing stuff under our own home dirs.

The only steps remaining are to add the new paths to the binary and library search paths. To so this, add the following lines to ~/.bash_profile



This is only efficient as long as the package does not have too many unmet dependencies -- since you will need to grab and install all missing dependencies along with the package itself. And even if you had installed some of the dependencies earlier using this method, rpm will not know about it since there will be no entry in the system rpmdb.

FC kernel rebuild HOWTO

Paul Howarth has a very nice article here:

The main benefit is that you can use rpmbuild to generate kernel RPMs using the same SPEC file as the distribution itself -- resulting in packages that are as easy to handle as those from FC itself.

Saturday, April 15, 2006

Write algorithms with LaTeX


Click on the link in "Algorithms with LaTeX" and download the package. The manual is extremely useful and the pseudocode looks wonderful!

By the way, I would suggest to anyone reading this to turn on Google's personalized search. I knew that I needed this package but I'd lost it after I moved to FC5. Every search I performed for ALgo in Google turned up something else. I had obviously used a different search phrase when I first found this package. Out of desperation, I searched my search history for ALgo and viola - it turned up right there! I had last searched for this package and successfully found it on Jan. 23, 2006. I think Google is a lifesaver and a timesaver! Thanks Larry and Sergey!