We have two repo A and B

Both repo provides package C

I dont want to use A for anything else , except for package C Rest all packages i want to install from B

How to tell yum to block A for all except C package



You should edit the .repo corresponding to A in /etc/yum.repos.d/ (probably C.repo), and add this line :


And add this in B.repo :


It should do the trick.

  • A good use case for this is using DRBD from Elrepo. The kernel modules lag behind the kernel from RHEL, but the Elrepo-testing repository did have more up-to-date packages. So in this case I just needed to use 'includepkgs=*drbd90*' and 'enabled=1' to the elrepo.repo file. – Cameron Kerr May 12 '18 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.