Make rpm auto install dependencies:
Create a (local) repository and use yum to have it resolve the dependencies for you.
- Create a directory for you local repository, e.g. /home/user/repo.
- Move the RPMs into that directory.
- Fix some ownership and file system permissions:
- Install the createrepo package if not installed yet, and run
- Create a repository configuration file, e.g. /etc/yum.repos.d/myrepo.repo containing
- Install your package using
Installing a RPM package Using rpm –ivh
- RPM filename has packagename, version, release and architecture name.
- For example, In the MySQL-client-3.23.57-1.i386.rpm file:
- When you install a RPM, it checks whether your system is suitable for the software the RPM package contains, figures out where to install the files located inside the rpm package, installs them on your system, and adds that piece of software into its database of installed RPM packages.
- The following rpm command installs Mysql client package.
- rpm command and options
- -i : install a package
- -v : verbose
- -h : print hash marks as the package archive is unpacked.
Install the stuff you need and make a place to put the downloaded RPMs :
- Download the RPMs. This uses the installroot trick suggested here to force a full download of all dependencies since nothing is installed in that empty root.
- Yum will create some metadata in there, but we’re going to throw it all away. Note that for CentOS7 releasever would be “7”.
- Yes, that was the small version. You should have seen the size of the full-repo downloads!
- Generate the metadata needed to turn our new pile of RPMs into a YUM repo and clean up the stuff we no longer need:
- Configure the download directory as a repo. Note that for CentOS7 the gpgkey would be named “7” instead of 6:
- To check the missing dependencies:
- why on CentOS7 this reports things like libssl.so.10(libssl.so.10)(64bit) missing from httpd-tools when openssl-libs-1.0.1e-51.el7_2.2.x86_64.rpm (the provider of that library) is clearly present in the directory.
- Still, if you see something obviously missing, this might be a good chance to go back and add it using the same yum install –download only method above.
- When offline or after copying the /var/tmp/httpd repo directory to the other server set up the repo there: