分享交流
合作共赢!

How to use yum to download a package without installing it

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:
    # yum install yum-utils
  2. Run the command followed by the desired package:
    # 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.
赞(0) 打赏
未经允许不得转载:琼杰笔记 » How to use yum to download a package without installing it

评论 抢沙发

评论前必须登录!

 

分享交流,合作共赢!

联系我们加入QQ群

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册