Random Wisdom

Tag: rpm

Installing RPMs as a regular user

by on Apr.20, 2006, under How To ..., Linux, Software

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
/usr/bin/foo
/usr/lib/foo.so.0.0
/usr/lib/foo.so.0
/usr/share/doc/foo/README

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

        PATH=$PATH:$HOME/myroot/usr/bin
        LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/myroot/usr/lib

        export PATH LD_LIBRARY_PATH

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.

Leave a Comment :, , more...

FC kernel rebuild HOWTO

by on Apr.20, 2006, under How To ..., Linux

Paul Howarth has a very nice article here:

http://www.city-fan.org/tips/TweakKernelPackage

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.

Leave a Comment :, , , more...

GPLFlash

by on Aug.19, 2005, under Linux, Software

Ever since I installed FC4 64-bit, plugins have been a constant pain is the a**. I remembered seeing a reference to GPLFlash some time back .. so I went and grabbed the source tarball .. unfortunately it requires too many *-devel packages and I can’t afford the disk space. So, rpm.pbone.net to the rescue. I managed to find a x86_64 rpm for SuSE 9.3 – so I’m gonna give that a go. Seems like it needs libresmgr which is not in any of the FC repos I use. So, I also needed to borrow that from SuSE.

It’s now that I fully appreciate the new localinstall option of yum. Point to to a local rpm and it sorts out dependencies from the actives repos .. just too cool..

Ok .. this isn’t going anywhere .. the dependencies are too SuSE centric .. guess I’ll just have to get the *-devel packages and make do with the source tarball..

Leave a Comment :, , , more...