Typically, you use Yum to install a dependency-pack relationship, and if one server cannot connect to the extranet or the Yum source is not set, you may want to download the RPM packages from another server and then install them. So how do you use the Yum tool to download the RPM package?
Using Yum
To use the--DOWNLOADONLY option, you need to install yum-plugin-downloadonly without installing the package, and you will report the following error message: Command line error:no such option:-- Downloadonly
The code is as follows:
# yum Install Yum-plugin-downloadonly
Then use the following command to download the package
The code is as follows:
# yum Install--downloadonly Rpm_name
The downloaded files are located in the/var/cache/yum/x86_64/6/directory, depending on the system version.
You can also specify the downloaded directory as follows:
The code is as follows:
# yum Install--downloadonly--downloaddir=/ttlsa rpm_name
At the same time, the dependent packages will be downloaded.
Using Yumdownloader
You need to install Yum-utils first.
The code is as follows:
# yum Install Yum-utils
Download package
The code is as follows:
# Yumdownloader Rpm_name
The downloaded package is located in the current directory. However, only the specified package is downloaded, and the packages that are dependent on the package are not downloaded.