Asked
Updated
Viewed
11k times

I am new to Linux. I have installed Red Hat and VMWARE and want to install Oracle Database. How can I install an RPM package that is in a different location on my USB Drive with Linux Red Hat where the path is:

[nauvm@localhost linuxpackage]# pwd
/home/usb/linuxpackage

[nauvm@localhost linuxpackage]# rpm -Uvh libXp-1*

I want to install the Oracle Database software into the OraSoft folder that is located on the desktop. I want to run the following commands:

gunzip 10201_database_linux_x86_64.cpio.gz
cpio -idmv < 10201_database_linux_x86_64.cpio
add a comment
0

2 Answers

  • Votes
  • Oldest
  • Latest
Answered
Updated

Some RPM packages can be installed in another directory, otherwise known to be relocatable. Some RPM packages you will not be able to do this for. You can easily check if an RPM package can be installed in another directory with the following command:

# rpm -qpi package.rpm | head -1
Name    : package            Relocations: (not relocatable)

You can see that the above output will let you know if its not relocatable. Alternatively, it might show a path under relocations.

# rpm -qpi package.rpm | head -1
Name    : package            Relocations: /usr

If it is relocatable then you can install the RPM package to a different directory than the default by using the --prefix argument:

rpm -ivh --prefix=/different/directory package.rpm

Finally you can verify that it was indeed installed in your custom directory with the following command:

rpm -ql package

That will output the files that were placed and show you exactly what directories they exist in. You are looking to see if they were indeed put in your custom directory.

If you try to do this on a RPM package that is NOT Relocatable, than you would get an error like this:

rpm -ivh --prefix=/different/directory package.rpm
error: package package is not relocatable
add a comment
0
Answered
Updated

Move all of the files to the desktop directory and execute the required commands.

Use the cd command to move around before running your commands.

add a comment
0