How to download only RPM package without installing it in CentOS system

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

copy code
code show as below:

# yum install yum-plugin-downloadonly


Then use the following command to download the package

copy code
code show as below:

# 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 download directory, as follows:

copy code
code show as below:

# yum install --downloadonly --downloaddir=/ttlsa RPM_Name


20151217120929764.jpg (836×532)

 

At the same time, all dependent packages will be downloaded.
To use yumdownloader, you
need to install yum-utils first.

copy code
code show as below:

# yum install yum-utils


Download package

copy code
code show as below:

# yumdownloader RPM_Name


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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326316016&siteId=291194637