Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 1 down vote accepted

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:

share|improve this answer
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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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