Local installation of .rpms using YUM

Too bad you accepted that rpm answer. That will lead to warnings from subsequent executions of yum, such as Warning: RPMDB altered outside of yum

Instead you should use yum localinstall, per section 13 of the Yum and RPM Tricks page of the CentOS wiki => https://wiki.centos.org/TipsAndTricks/YumAndRPM#head-3c061f4a180e5bc90b7f599c4e0aebdb2d5fc7f6

You can use the --installroot option to specify a different installation root.


Use rpm

rpm -ivh package.rpm

If you want to install it on different place use:

rpm -ivh -r /new/path package.rpm

but be aware under new root will be recreated the directory structure from package