Is there any way to prevent yum from upgrading a package obsoleted by another?

I have created a custom repo containing some packages, among them openh323-devel. In current versions of CentOS, openh323 is marked as being obsoleted by OPAL, but I don't want to compile other software (namely YATE) against OPAL. I have openh323-devel installed, but every time I do yum update, it wants me to upgrade it to OPAL.

Is there any way I can tell yum that I permanently don't want to use OPAL (or any other superseding package for that matter) in a manner similar to apt pinning? Of course, I can --exclude specific packages, but that's not what I want.


You should be able to permanently add an exclude rule by adding it to your /etc/yum.conf file. You can also use wildcards to exclude more than one package based on a pattern. Try:

  • OK, thanks, but that's what I'm doing at the moment. What I was thinking about was some method to prevent yum from upgrading any obsoleted packages. Probably I'll just stay with this method. – galo May 19 '11 at 6:37
  • If you don't want to upgrade ANYTHING why are you running yum at all? – Caleb May 19 '11 at 8:15
  • Heh, I still want to update all other system packages (for security, patches, etc.), I just don't want yum to mess with my custom package. What makes it funnier is that if I put newer version of openh323 to my repo, yum still prefers opal over it. Apparently, excluding is a way to go here. Thanks again! – galo May 19 '11 at 8:20
sudo yum --setopt=obsoletes=0 install obsoleted-package

Or you can put




Both ways worked for me on Oracle Linux 6.7.

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.