yum install in user home for non-admins

Rather than use yum, find the rpms you want and download them. You still can't install them directly without being root, but RPM packages are actually fancy .cpio files, and you can unpack their contents. The easiest way to do this is probably via the mc ("midnight commander") file browser (one of the greatest pieces of software ever), which allows you to browse the contents of an .rpm and copy files straight out of it.

Sans that, you can use rpm2cpio to convert it to .cpio, then cpio to extract the files inside and put them in the right places. Both of these will already be installed on a redhat or fedora system. Here's an example installing "xsnow" (you probably want to do this in an empty directory):

»rpm2cpio xsnow-1.42-17.fc17.x86_64.rpm > xsnow.cpio

Notice I found an .rpm appropriate to my system, fc17 x86_64. This is important because these are precompiled binaries that are linked against other components. Now extract the .cpio:

»cpio -idv < xsnow.cpio 
./usr/bin/xsnow
./usr/share/doc/xsnow-1.42
./usr/share/doc/xsnow-1.42/README
./usr/share/man/man6/xsnow.6.gz
212 blocks
Press any key to continue...

If I browse through this directory tree, everything I need is there, except some of the meta-information that might help me resolve dependencies. This can be found using rpm -q -p [package] --[query]:

»rpm -q -p xsnow-1.42-17.fc17.x86_64.rpm --requires
warning: xsnow-1.42-17.fc17.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID d2382b83: NOKEY
libX11.so.6()(64bit)  
libXext.so.6()(64bit)  
libXpm.so.4()(64bit)  
libc.so.6()(64bit)  
libc.so.6(GLIBC_2.2.5)(64bit)  
libc.so.6(GLIBC_2.3.4)(64bit)  
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)  
rpmlib(PayloadIsXz) <= 5.2-1

Pretty sure I already have all this stuff. So now all I have to do is put the xsnow executable in my $PATH, which already includes a bin in my home directory:

»cp ./usr/bin/xsnow ~/bin

Viola! Now I can type xsnow and watch nothing, since as it turns out xsnow does not play well with KDE :( but hopefully the jist of the process is clear. I did not have to do anything outside my home directory.

If you need to install libraries you will need to create a directory in home for them too and add to ~/.bashrc:

export LD_LIBRARY_PATH=/home/you/lib

Most binaries are compiled to be installed into certain locations under /.

There are non-root package managers like Gentoo Prefix and Rootless GoboLinux and maybe 0install.

As you said compiling yourself would alleviate that issue, or using a chroot. However, your biggest hurdle with chrooting will be the prerequisites and linking to kernel shared objects.

Tags:

Rpm

Yum