Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to instruct yum to install a specific package (rpm) from a specific repo

Tags:

rpm

yum

If the rpm package is available in multiple repos (configured in /etc/yum.repos.d/ directory), yum is scanning all the repo files and installing it from the one which has the latest version of that package.

I want the package to be downloaded from a specific repo, also I don't want to completely disable the other repositories, instead, I want just one package to be fetched from a specific repo, and disable it from getting downloaded from other repo.

I also don't want to use the version as a filter as there could be the same version of the same package present on multiple repos.

like image 288
Vivek Avatar asked Aug 22 '18 09:08

Vivek


1 Answers

you can tell yum which repositories he can use:

yum --disablerepo="*" --enablerepo="<desired-repo-id>" install package-name

This does not permanently enable/disable repositories; just for this command execution.

like image 50
Chris Maes Avatar answered Nov 16 '22 03:11

Chris Maes