The yumdownloader command can be used to download but not install a package. The yumdownloader command is included in the yum-utils package.
yum install yum-utils
In this example, yumdownloader is used to download the httpd package. This will download an RPM. The RPM command can be used to install the package.
yumdownloader httpd . . . Loaded plugins: fastestmirror Loading mirror speeds from cached host file * base: mirror.es.its.nyu.edu * extras: mirrors.gigenet.com * updates: mirror.nexcess.net httpd-version.rpm
By default, the RPM of the package will be downloaded into the present working directory. The --destdir option can be used to specify a directory for the RPM.
yumdownloader --destdir /home/<username>/Downloads httpd
Following are commonly used yum commands.
Alternatively, the Ansible yum module can be used to automate the process of managing packages.