How do I install an RPM package into a different directory?

by Vivek Gite on January 26, 2008 · 1 comment

Q. How do I install an RPM package into a different directory like /home/chroot under RHEL / Fedora / CentOS Linux server?

A.An RPM package that can be installed into a different directory is said to be relocatable. The --prefix NEWPATH option is used for for relocatable binary packages. It translate all file paths that start with the installation prefix in the package relocation hint(s) to NEWPATH. For example, package bind-chroot or rsync or bash can be installed into another directory called /opt or /home/chroot. First find out whether a particular package is relocatable or not using rpm -qi command itself:
$ rpm -qi {package-name}
To install an RPM package into a diffrent directory type:
# rpm --prefix=/home/chroot/ bind-chroot*.rpm
To verify package file listing enter:
# rpm -ql bind-chroot

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 1 comment… read it below or add one }

1 Reynold September 6, 2011

Thanks for the post Vivek:)
It would be great if you could include the relocation concept in debain packages also ….

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 14 + 10 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: