Install RPM Packages without root
RPM is a free and open-source package manager (originally created for Red Hat Linux) that performs software installation and maintenance tasks on RHEL, CentOS, and Fedora Linux.
Installing software on Linux often requires an elevated user account (root user, a.k.a. superuser) since changes to the system files and directories can affect the stability and security of the system.
On Linux, regular users can gain temporary administrative privileges by so called sudo (short for "superuser do") command. Users that belong to the sudo group can execute commands with root privileges by entering their own password.
The following may help if one may need to install rpm packages without the root user account,
export RPM_PATH="$HOME/.local"
rpm --initdb --root $RPM_PATH --dbpath $RPM_PATH/lib/rpm
rpm --root $RPM_PATH --dbpath $RPM_PATH/lib/rpm --relocate /usr/local=$RPM_PATH --nodeps -ivh package.rpm
You can --relocate /etc=$RPM_PATH/etc
Consider setting the --noscripts option, if the RPM runs any scripts as root.
Extract RPM packages
Basically, the `rpm` package is a `cpio` archive. There is a `rpm2cpio` utility that prints to STDOUT. One can extract the rpm packages using the following command:
rpm2cpio package.rpm | cpio -idv