Usually, yum is used to install and resolve the dependency package relationship. If there is a server that cannot connect to the external network or the yum source is not set up, I hope to download these RPM packages through another server, and then install them. So how to use yum tool to download RPM package?
To use yum
to use the --downloadonly option, you need to install yum-plugin-downloadonly first. If the package is not installed, the following error message will be reported: Command line error: no such option: --downloadonly
Then use the following command to download the package
The downloaded files are located in the /var/cache/yum/x86_64/6/ directory, depending on the system version.
You can also specify the download directory, as follows:
At the same time, all dependent packages will be downloaded.
To use yumdownloader, you
need to install yum-utils first.
Download package
The downloaded package is located in the current directory. However, only the specified package is downloaded, and all the packages that the package depends on will not be downloaded.
http://www.jb51.net/os/RedHat/410735.html