• 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

Downloading a Specific Version of Package and Its Dependencies from Repository for Offline Installation Using YUM

by admin

Question : How to download a specific version of the package along with its dependencies using YUM offline.

Answer :
1. To see what particular versions are available to you via yum you can use the –showduplicates switch.

# yum --showduplicates list [package_name]

For Example :

# yum --showduplicates list httpd
Loaded plugins: product-id, security, subscription-manager.
Installed Packages
httpd.x86_64 2.2.15-39.0.1.el6 @ol6_x86_64_latest         --- installed
Available Packages
httpd.x86_64 2.2.15-5.0.1.el6 ol6_x86_64_latest           --- older versions
httpd.x86_64 2.2.15-9.0.1.el6 ol6_x86_64_latest
....

2. If there is a need to download the older version package along with its dependencies for an off-line installation, you can use one of the following options to download a particular version of RPM from the web, and then use yum to install it.

Method 1

To download the packages into a local directory, use – -downloaddir=[dir] option along with the –downloadonly switch of yum command.

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

For example :

# yum install --downloadonly --downloaddir=/tmp/ httpd.x86_64 2.2.15-5.0.1.el6

Method 2

To download package with its dependencies using yumdownloader :

# yumdownloader [package]

To download the package to a local folder try the option “- -destdir=DESTDIR”

# yumdownloader --destdir=[DIR] [package]

For example :

# yumdownloader --destdir=/tmp httpd.x86_64 2.2.15-5.0.1.el6

To download the packe along with all dependencies, use option “- -resolve” along with “- -destdir”

# yumdownloader --destdir=[DIR] --resolve [package]

Installing packages locally

Now install the packages from the local directory with yum command option “localinstall”

# yum localinstall [path to rpm]

Filed Under: Linux

Some more articles you might also be interested in …

  1. UNIX / Linux : Examples of bash history command to repeat last commands
  2. gh codespace: Connect and manage your codespaces in GitHub
  3. Status Commands in Linux – date, ps, who, uptime, finger, rup, ruser
  4. kpackagetool5 Command Examples in Linux
  5. How to add swap space in linux
  6. dpkg-reconfigure Command Options
  7. file Command Examples in Linux
  8. cpuid Command Examples in Linux
  9. How to view file size/details from ls command in Unix
  10. ac Command Examples in Linux

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