Install a rpm in home directory as non-root
July 10th, 2009
Do you ever need to install a rpm package however don't have permission to do it as root. You can install the rpm in your personal home folder as long as all the pre-requisites are met.
Here is how.
Step 1. Intialize your own private rpm db
rpm --initdb --root /home/username/local --dbpath /home/username/local/lib/rpm |
Step 2. See what files are in the rpm and where they will be installed by default. Relocate the path to your rpm root directory.
rpm -qlp package.rpm |
This will list all the files in the rpm. If they all start with /usr, we can just use /home/username/local as the new path as shown below.
Step 3. See if all dependent rpm met?
rpm -ivh package.rpm |
This will fail as you don't have permission to install. However if doesn't complain about dependent files then you are good. Other install the dependent rpms first.
Step 4. Install the rpm
1 2 |
rpm --root /home/username/local --dbpath /home/username/local/lib/rpm \ --relocate /usr=/home/username/local --nodeps -ivh package.rpm |
You have to add the flag --nodeps as the dependent rpms are in the system rpm database but not in your own.



Leave a Reply