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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. konsole: command not found
  2. kwrite Command Examples in Linux
  3. e2label: command not found
  4. Audit Log And Messages File Not Rotating on CentOS/RHEL
  5. Choosing SSSD or Winbind & Samba for Active Directory Integration in CentOS/RHEL
  6. getfacl Command Examples in Linux
  7. How to configure xhost to be persistent across reboots in Linux
  8. How to remove unwanted entries in /etc/shadow file
  9. foreman Command Examples in Linux
  10. grub2-mkpasswd-pbkdf2: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright