Showing posts with label yum-utils. Show all posts
Showing posts with label yum-utils. Show all posts

Thursday, November 5, 2020

Download rpm installer file for already installed packages

If you have not install the packages, you can always use --downloadonly flag to just download the packages without installing. For example, I want to download rpm file for curl

# yum install --downloadonly curl


The file and its dependencies will be saved into /var/cache/yum.


But if you have installed the package, the above command will only return a message saying that "Packages is already installed, and nothing to do."


In order to download rpm file of an installed package with dependencies, another command is needed, which is repotrack, that is a command in yum-utils package.


First, install yum-utils

# yum install -y yum-utils


Then, run repotrack on the package that you need the rpm installer

# repotrack curl


All the packages will be downloaded to the current directory. Nice!

Saturday, August 4, 2018

Download rpm with dependencies without installing

The tool we are going to use is yum-utils. First, you need to install yum-utils


# yum install yum-utils

Then, use yumdownloader command, to download the package, adding --destdir for destination the files are going to be downloaded, and --resolve to make yumdownloader download the dependencies as well. For example, I want to download rpm for elinks, and its dependencies, to /tmp:

# yumdownloader --destdir=/tmp --resolve elinks

That's all folks, happy rpm downloading :)