• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to use “yum downloadonly” to download a package without installing it

by admin

Ther are multiple ways in which you can download a yum package without installing it. The 2 most commonly used methods are described here in the post.
1. using the “downloadonly” plugin for yum
2. using “yumdownloader” utility.

Method 1 : using the “downloadonly” plugin for yum

1. Install the package including “downloadonly” plugin:

# yum install yum-plugin-downloadonly

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

# yum install --downloadonly --downloaddir=[directory] [package]

For example to download the package for firefox without actually installing it, use the command shown below:

# yum install --downloadonly --downloaddir=/tmp firefox

yum downloadonly - download yum packages without installing them

The firefox package gets downloded into the specified /tmp directory. Confirm the RPM files are available in the specified download directory.

# ls -lrt /tmp/firefox-52.5.0-1.el7.centos.x86_64.rpm 
-rw-r--r--. 1 root root 87273716 Nov 17 16:21 /tmp/firefox-52.5.0-1.el7.centos.x86_64.rpm
Note: If you do not specify the –downloaddir option, the files are saved by default in /var/cache/yum/ in rhel-{arch}-channel/packages

3. You can also download multiple packages at the same time using the downloadonly plugin. For example to download packages for firefox and mutt at the same time, use the command below :

# yum install --downloadonly --downloaddir=/tmp firefox mutt
Note: 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 mutt-1.5.21-27.el7.x86_64).

Method 2 : using the “yumdownloader” utility

The “yumdownloader” command is particularly useful when you want to download a package which is already installed on your system.

1. Install the yum-utils package:

# yum install yum-utils

2. Run the command followed by the desired package.

# yumdownloader [package]

For example to download a package for mutt which is already installed on the system, use the below command.

# yumdownloader mutt
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.vcu.edu
 * epel: mirror.us.leaseweb.net
 * extras: mirror.lug.udel.edu
 * nux-dextop: li.nux.ro
 * updates: mirror.wdc1.us.leaseweb.net
mutt-1.5.21-27.el7.x86_64.rpm                 | 1.4 MB  00:00:00

3. You would find the latest mutt package downloaded in the current working diretory.

# ls -lrt mutt-1.5.21-27.el7.x86_64.rpm 
-rw-r--r--. 1 root root 1444476 Aug 10 18:21 mutt-1.5.21-27.el7.x86_64.rpm

You can also specify a download directory to download the package. For example,

# yumdownloader --destdir=/var/tmp mutt
Note: Be sure to add –resolve to the yumdownloader utility, if you need to download dependencies.

Filed Under: Linux

Some more articles you might also be interested in …

  1. top Command Examples in Linux
  2. hledger Command Examples
  3. hakyl-init Command Examples
  4. firebase – Test, manage, and deploy Firebase projects from the command-line
  5. “git revert” Command Examples
  6. diff: command not found
  7. ghdl: Open-source simulator for the VHDL language
  8. pgrep: command not found
  9. lsusb Command Examples in Linux
  10. jekyll Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright