You are on page 1of 2

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

Issue
How to use yum to download a package without installing it.

Environment
Red Hat Enterprise Linux 5

Resolution
Please confirm package yum-downloadonly has been installed on the system. If not, this package is available on the Red Hat Network (RHN). If the system has been registered to the Red Hat Network, install the yum-downloadonly package with the following command:
#yum install yum-downloadonly

yum-downloadonly is a plugin which can be used to download packages from RHN or a configured yum repository without installing the package. Check contents of file /etc/yum/ pluginconf.d/downloadonly.conf and make sure this plugin is enabled:
[main] enabled=1

For example, run the following command to download the newest version of vsftpd, if it is available, without installing it:
# yum install --downloadonly vsftpd Loading "downloadonly" plugin Loading "rhnplugin" plugin rhel-i386-server-5 100% |=========================| 1.4 kB Setting up Install Process Parsing package install arguments Package vsftpd - 2.0.5-10.el5.i386 is already installed. Resolving Dependencies --> Running transaction check ---> Package vsftpd.i386 0:2.0.5-12.el5 set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================================= Package Arch Version Repository Size =============================================================================

00:00

Copyright (c) 2010 by Red Hat, Inc. All rights reserved. 1

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

Updating: vsftpd

i386

2.0.5-12.el5

rhel-i386-server-5 138 k

Transaction Summary ============================================================================= Install 0 Package(s) Update 1 Package(s) Remove 0 Package(s) Total download size: 138 k Is this ok [y/N]: y Downloading Packages: (1/1): vsftpd-2.0.5-12.el 100% |=========================| 138 kB exiting because --downloadonly specified

00:02

The package, by default, is saved in directory /var/cache/yum/ in rhel-i386-server-5. Pass the option --downloaddir with --downloadonly to yum, to specify an alternate directory to store packages:
#yum install --downloadonly --downloaddir=/tmp vsftpd

The newest version of vsftpd, if it exists, is downloaded.

To download a package that is currently installed, please use yumdownloader instead. For example, httpd-2.2.3-22.el5 is installed in system:
# rpm -q httpd httpd-2.2.3-22.el5

Download that package with yumdownloader:


# yumdownloader httpd-2.2.3-22.el5 Loaded plugins: fastestmirror, kmod, protectbase, rhnplugin, versionlock Loading mirror speeds from cached hostfile Reading version lock configuration 0 packages excluded due to repository protections httpd-2.2.3-22.el5.i386.rpm

That downloaded package is saved in the current directory. Option --destdir can be used to specify a specific destination directory for the download. Please visit the man page for yumdownloader for more details.

Copyright (c) 2010 by Red Hat, Inc. All rights reserved. 2

You might also like