Yum is the package installer for all RHEL based systems. That’s Red Hat, CentOS, Oracle Linux and ClearOS to name a few. Yum has many options and here we are going to explain the yum download only option.
Yum Download Only
The download only option just downloads a package to your VPS without installing it. It’s a plugin that can be installed via yum and is not included by default on CentOS 5 or 6 but it is included in CentOS 7 systems.
Install Download Only
To install the download only plugin and enable yum –download as an option use the commands below
CentOS 6
yum install yum-plugin-downloadonly
CentOS 5
yum install yum-downloadonly
You should now be able to download a package to your sevrer without installing it. Let’s try a test file. We will download OpenVPN to our tmp folder.
yum install --downloadonly --downloaddir=/tmp openvpn.x86_64
CT-4452 tmp ls -ltr /tmp
total 592
-rw-r--r-- 1 root root 57220 Dec 3 2014 pkcs11-helper-1.11-3.el7.x86_64.rpm
-rw-r--r-- 1 root root 536771 Apr 24 21:46 openvpn-2.4.9-1.el7.x86_64.rpm
Here we can see we have downloaded OpenVPN with yum but not installed it. You can specify any directory to download to by using the –downloaddir=/tmp switch.
Enable Download Only
If upon installing the download only plugin, the command does not work check to ensure the plugin is enabled. (CentOS 5 & 6 only)
nano /etc/yum/pluginconf.d/downloadonly.conf
Change enabled=0 to enabled=1
enabled=1
If you don’t specify a location for the plugin to download to then programs are downloaded to the /var/cache/yum/ in rhel-{arch}-channel/packages file
How was this article?
You might also like
More from Dedicated Servers
Cloud-init Modules That Automate and Customize Deployments
Cloud-init is a popular way to automate deployments of instances in a cloud or none cloud environment. To save having …
Take Rdiff-Backup incremental backups of data in Linux Servers
Taking backups of your data in Linux is likely one of the most important things you can do. No one …
How To Use NGINX To Host A Website With PHP 7.4 On Ubuntu 20
In a previous article, we talked about how to host a website using Apache Virtual Hosts. We set up a …