Download rpm packages from repository on CentOS7

Sometime we need to have a copy of the rpm package. There are many ways to acquire the packages such as wget or directly from repository url from browser. But if you don’t know the url or too lazy to find out, you can use yumdownloader command and it will do the rest for you.

Install yum-utils to obtain yumdownloader command.

yum install yum-utils

yumdownloader
yumdownloader

Then we can download the rpm package with command

yumdownloader httpd

yumdownloader

And there you go, now you can do whatever you want with it.
yumdownloader