Home Linux Community Forums Software Command Line RPM Installation in different directory

RPM Installation in different directory

Link to this post 24 Apr 12

Suppose I need to install rpm file <unrar.*****.rpm> in /opt.
I tried with rpm --prefix=/opt/ unrar.*****.rpm

I get this statement

rpm: --prefix may only be used when installing new packages

...How to go about this?

P.S (By default it is installed in /usr/bin/unrar)


Link to this post 24 Apr 12

An RPM package that can be installed into a different directory is called relocatable. It is necessary to find out whether this rpm is relocatable / not.... To check this type as: rpm -qpi filename.rpm | grep Relocations and also again type as: rpm -qi bash | grep Relocations, if it shows dir name like /opt or /usr or other name then it can be install in different dirs. Almost ur command is ok, actual the syntax is like: rpm --prefix=/opt/unrar*.rpm !

Link to this post 24 Apr 12

Thanks for your quick response.
This is what I get
#rpm -qpi unrar-3.6.2-1.el4.rf.i386.rpm | grep Relocations
warning: unrar-3.6.2-1.el4.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6Name : unrar Relocations: (not relocatable)
# rpm -qi bash | grep Relocations
Name : bash Relocations: /usr

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board