CentOS system only download RPM package without installation method

Source: Internet
Author: User
Tags centos

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.