using rpms for non-root installs

Stephan Bergmann sbergman at redhat.com
Fri Feb 1 09:12:48 UTC 2013


On 01/31/2013 08:40 AM, Michael Stahnke wrote:
> You actually may have an option. It's dirty, and here be dragons. I
> know this from working on RPM on AIX, so again, it's hacky. I did this
> on a CentOS 6.3 box for my example, should work on Fedora.
>
> You can do something like:
>
>    ls zip-3.0-1.el6.x86_64.rpm
>    mkdir $HOME/.myrpm
>    cp -pr /var/lib/rpm/* $HOME/.myrpm/
>    chown -R $USER  $HOME/.myrpm/
>    rpm -Uvh --justdb --dbpath $HOME/.myrpm zip-3.0-1.el6.x86_64.rpm
>    rpm2cpio < zip-3.0-1.el6.x86_64.rpm | cpio  -idmv
>    rpm -q --dbpath $HOME/.myrpm zip
>
> Results:
>
> [vagrant at localhost ~]$ rpm -q --dbpath /home/vagrant/.myrpm zip
> zip-3.0-1.el6.x86_64
> [vagrant at localhost ~]$ rpm -q zip
> package zip is not installed
>
>
> You now have zip installed (and rooted) in $HOME.  You'd have to add
> the --dbpath option to rpm any time you used it, and it would get out
> of sync with the system rpm database unless you wrote some tooling
> around that. But it's completely do-able.
>
> Again, it's ugly and I don't recommend it.

FWIW, we have a similar script for LibreOffice, 
<http://cgit.freedesktop.org/libreoffice/core/tree/setup_native/scripts/install_linux.sh> 
(inherited from its OpenOffice.org ancestry), and at least back in OOo 
times used it frequently to install instances "to the side."  Worked 
reasonably well.

Stephan


More information about the devel mailing list