How to download a package using YUM


There are two methods to download a package without installing it.

Method 1:

Install required plugin for yum

[root@server ~]# yum install yum-plugin-downloadonly

Run yum command with “–downloadonly” option:

[root@server ~]# yum install --downloadonly --downloaddir=/data createrepo

where,
createrepo === package to download from yum

Method 2:

Install required package for yum to download

[root@server ~]# yum install yum-utils

Run the command followed by the desired package:

[root@server ~]# yumdownloader --destdir /data --resolve createrepo

where,

createrepo === package to download from yum
–resolve === download the dependency packages