yum downloadonly

简介:

How to use yum to download a package without installing it

 SOLUTION VERIFIED - Updated October 22 2015 at 2:36 PM - 

English 

Environment

  • Red Hat Enterprise Linux (RHEL) 7

  • Red Hat Enterprise Linux 6

  • Red Hat Enterprise Linux 5

Issue

  • How do I 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:

    Raw

    (RHEL5)
    # yum install yum-downloadonly
    
    (RHEL6)
    # yum install yum-plugin-downloadonly
  2. Run yum command with "--downloadonly" option as follows:

    Raw

    # yum install --downloadonly --downloaddir=<directory> <package>
  3. Confirm the RPM files are available in the specified download directory.

Note:

  • Before using the plugin, check /etc/yum/pluginconf.d/downloadonly.conf to confirm that this plugin is "enabled=1"

  • This is applicable for "yum install/yum update" and not for "yum groupinstall". Use "yum groupinfo" to identify packages within a specific group.

  • If only the package name is specified, the latest available package is downloaded (such as sshd). Otherwise, you can specify the full package name and version (such as httpd-2.2.3-22.el5).

  • If you do not use the --downloaddir option, files are saved by default in /var/cache/yum/ in rhel-{arch}-channel/packages

  • If desired, you can download multiple packages on the same command.

  • You still need to re-download the repodata if the repodata expires before you re-use the cache. By default it takes two hours to expire.

Yumdownloader

If downloading a installed package, "yumdownloader" is useful.

  1. Install the yum-utils package:

    Raw

    # yum install yum-utils
  2. Run the command followed by the desired package:

    Raw

    # yumdownloader <package>

Note:

  • The package is saved in the current working directly by default; use the --destdir option to specify an alternate location.

  • Be sure to add --resolve if you need to download dependencies


本文转自 Wilson9527 51CTO博客,原文链接:http://blog.51cto.com/devops9527/1888910,如需转载请自行联系原作者
相关文章
yum -y --downloadonly --downloaddir=/root/ruiy update
依赖关系解决================================================================================================================================================...
649 0
|
7天前
|
关系型数据库 MySQL Linux
Linux 安装 mysql【使用yum源进行安装】
这篇文章介绍了在Linux系统中使用yum源安装MySQL数据库的步骤,包括配置yum源、安装MySQL服务、启动服务以及修改root用户的默认密码。
Linux 安装 mysql【使用yum源进行安装】
|
4月前
yum 可以安装rpm包
【6月更文挑战第18天】yum 可以安装rpm包
442 0
|
2月前
|
关系型数据库 MySQL Linux
在CentOS上使用yum安装与使用MySQL
在CentOS操作系统上使用yum包管理器安装和配置MySQL数据库的详细步骤,包括下载MySQL的yum源配置、安装MySQL服务、启动和停止服务、设置开机自启动、获取临时密码、修改root用户密码、授权用户以及处理相关问题。同时,文章还包含了一些操作的截图,帮助用户更直观地理解安装和配置过程。
367 0
在CentOS上使用yum安装与使用MySQL
|
2月前
|
Oracle Java 关系型数据库
yum安装指定版本的openJDK
yum安装指定版本的openJDK
|
2月前
|
Web App开发 缓存 Ubuntu
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
138 11
|
2月前
|
网络协议 Linux
CentOS7 yum安装报错“Could not resolve host: mirrorlist.centos.org;"之解决办法(换源)
CentOS7 yum安装报错“Could not resolve host: mirrorlist.centos.org; Name or service not known“之解决办法(换源)
|
2月前
|
Linux Docker 容器
在CentOS操作系统上使用yum安装/使用/卸载Docker容器引擎
在CentOS操作系统上安装、配置、使用和卸载Docker容器引擎的详细步骤,包括配置Docker镜像加速的方法。
216 0
|
2月前
|
安全 Java 应用服务中间件
如何通过 Yum 在 CentOS 7 上安装 Apache Tomcat 7
如何通过 Yum 在 CentOS 7 上安装 Apache Tomcat 7
119 0
|
2月前
|
jenkins Java Devops
CentOS 7上安装 Jenkins 2.346 -- yum 方式
CentOS 7上安装 Jenkins 2.346 -- yum 方式
85 0