About Linux FAQ

Browse More FAQs:

Explain: Red Hat Linux RPM Relocatable and Not Relocatable Packages

Posted by Vivek on Wednesday March 26, 08 @6:48 pm

Q. Can you explain CentOS / RHEL / Fedora Linux relocatable package concept?

A. RPM has the ability to give users some latitude in deciding where packages are to be installed on their systems. However, package builders must first design their packages to give users this freedom. In other words, an RPM package that can be installed into a different directory is said to be relocatable. Please note that not all RPM packages can be installed into another directory.

Task: Find out if whether a particular package is relocatable or not

Use rpm command as follows:
$ rpm -qi {package-name} | grep Relocations
$ rpm -qpi package.file.rpm | grep Relocations
$ rpm -qi bash | grep Relocations

Sample output (it means bash package can be installed in diffrent directory such as /home/chroot/users/):

Name        : bash                         Relocations: /usr

Following package is not relocatable:
$ rpm -qi keyutils-libs | grep -i Relocations
Output:

Name        : keyutils-libs                Relocations: (not relocatable)

Task: Install package into a different directory

rpm command has --prefix option. It allows to install package in diffrent directory. For example, install bash into /opt directory:
# rpm --prefix=/opt bash*.rpm

See also:

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Linux / UNIX FAQ:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , ~ Last updated on: March 26, 2008

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.