This information comes from a blog post I wrote some time ago.
First, create a Virtual Machine and do a fresh install of the same RHEL version on it. Make sure you perform a minimal installation so that the packages installed on the machine are kept to the minimum required for the machine to run.
Then, run the following commands on the machine:
[vm]# mkdir /root/tmppkg
[vm]# yum --downloadonly --downloaddir=/root/tmppkg install foobar
Yum will download Foobar and all its dependencies recursively, storing the RPMs in the directory mentioned above.
Create a repository from the bunch of packages downloaded by Yum.
[vm]# chown -R root:root /root/tmppkg
[vm]# createrepo /root/tmppkg
[vm]# chmod -R 755 /root/tmppkg
Transfer the tmppkg
directory on the server (via USB thumb drive or CD-ROM) and put it in the /share
directory. Then create a file /etc/yum.repos.d/local.repo
as such:
[local]
name=Local repository
baseurl=file:///share/tmppkg
enabled=1
gpgcheck=0
protect=1
Now you can install the Foobar package on the server in the usual way. The package manager will fetch all the necessary content from the newly created local repository:
[server]# yum install foobar
Once you’ve installed the package, the /share/tmppkg
directory can be safely deleted.
Best Answer
Yum maintains a cache of the RPMs it downloads here:
For example my box is Fedora 14, x86_64 architecture so I have the following:
But the RPMs that get installed are basically like a zip or tar file. So the contents of these files get dumped into the system and RPM maintains a database of what packages it has installed. The RPM "database" is located in this directory:
You can see where files get installed per each RPM with these commands.
what files are in an installed RPM
package info about a given RPM