How does Linux modify the RPM installation directory?

  
                

Most people on Linux use the rpm -i xxxx.rpm command to install the RPM package. In this case, the RPM will be installed in the default directory. What if I don't want to install RPM in this directory? Here's a look at how Linux can modify the RPM installation directory.

First, use the following command to see what the default installation directory of the RPM package, for example:

easwy: ~ $ rpm -qpl ext3grep-0.10.0-1.el5.rf .i386.rpm

/usr/bin/ext3grep

/usr/share/doc/ext3grep-0.10.0

/usr/share/doc/ext3grep-0.10 .0/INSTALL

/usr/share/doc/ext3grep-0.10.0/LICENSE.GPL2

/usr/share/doc/ext3grep-0.10.0/NEWS

/usr/share/doc/ext3grep-0.10.0/README

The above command lists the location where each file will be installed. Now we only need to re-use the –relocate parameter to install the directory. Just locate it:

rpm -i --relocate /usr/bin=/home/easwy/bin --relocate /usr/share/doc=/home/easwy/doc ext3grep-0.10.0 -1.el5.rf.i386.rpm

Now, ext3grep will be installed into the /home/easwy/bin directory.

The above is the way Linux modifies the RPM installation directory. If you do not have root privileges and cannot install the RPM in the default directory, you can use this method to modify the RPM installation directory.

Copyright © Windows knowledge All Rights Reserved