yum下载包&强制安装

来源:互联网 发布:p2pwificam电脑版软件 编辑:程序博客网 时间:2024/06/10 00:21

How to use yum to download a package without installing it ?

Resolution

There are two ways to download a package without installing it.

One is using the “downloadonly” plugin for yum, the other is using “yumdownloader” utility.

一、Downloadonly plugin for yum

1、Install the package including “downloadonly” plugin:

(RHEL5)# yum install yum-downloadonly(RHEL6)# yum install yum-plugin-downloadonly

2、Run yum command with “–downloadonly” option as follows:

# yum install --downloadonly --downloaddir=<directory> <package>

3、Confirm the RPM files are available in the specified download directory.

Example:

yum install -y yum-downloadonlyyum install python -y --downloadonly --downloaddir=/optrpm -ivh --force --nodeps python.el6.x86_64.rpm# --force 强制# --nodeps 不考虑依赖性

二、Yumdownloader

If downloading a installed package, “yumdownloader” is useful.

1、Install the yum-utils package:

# yum install yum-utils

2、Run the command followed by the desired package:

# yumdownloader <package>
0 0
原创粉丝点击