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