2

On EC2 / Amazon Linux AMI (Centos based), I created /etc/yum.repos.d/nginx.repo:

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1

Then I successfully installed nginx 1.4.2:

sudo yum --disablerepo="*" --enablerepo="nginx" install nginx

Now, when I run sudo yum update, I get:

---> Package nginx.x86_64 0:1.4.2-1.el6.ngx will be updated
---> Package nginx.x86_64 1:1.2.9-1.11.amzn1 will be an update

NO!

How do I permanently block the update? (which is actually a downgrade)

4
  • Stop using Amazon Linux. – Michael Hampton Aug 19 '13 at 23:31
  • @MichaelHampton As Stefan Lasiewski points out and as I've read elsewhere, in this case nginx got it wrong. By the way, in general, I am very happy with Amazon's Linux AMI, which I configured for a client years ago (Apache, PHP, MySQL, Shell). Now, I set up nginx on my own EC2 instance, for proxying to Node.js projects (incl. WebSockets). – feklee Aug 20 '13 at 9:51
  • 2
    Actually it's Amazon that screwed this up, by assigning an Epoch to their nginx package. – Michael Hampton Aug 20 '13 at 13:38
  • @MichaelHampton Thanks for pointing that out. According to yum info nginx (repository amzn-updates), the Epoch tag is set to a value of 1. The package from repository nginx has no epoch tag. – feklee Aug 20 '13 at 19:18
7

Maintainers of third party repositories should name their packages in a way that doesn't interfere with the main repository, otherwise conflicts like this will happen. Conflicts like the above are unprofessional and a sign of poor quality.

Some workarounds are:

YUM priorities

You can use Yum Priorities configure each repo to use a certain priority by assigning priority=N to the repositories listed in the .repo file. Some Yum developers have criticized Yum Priorities. Read the "Cautionary Note" at the bottom.

Excluding packages

You can also exclude packages from certain repositories. So, add something like this to your main repo. Substitute your package names.

[main]
exclude=php* kernel* 
3
  • 1
    Appending priority=1 to /etc/yum.repos.d/nginx.repo did the trick: No Packages marked for Update – feklee Aug 20 '13 at 9:44
  • Priorities is the only real option you have, since the problem is that Amazon put an Epoch on their nginx packages for no apparent (and probably no good) reason. – Michael Hampton Aug 20 '13 at 13:39
  • yum-versionlock might be a solution too, but if you don't want to upgrade package from same repo too. – GioMac Aug 20 '13 at 15:29
1

You can use yum update-minimal

update-minimal Works like upgrade, but goes to the 'newest' package match which fixes a problem that affects your system

0

You can use the following command to specify packages not to be updated:

yum --exclude=nginx* update

1
  • But I do want updates, though only from the nginx repo. – feklee Aug 19 '13 at 22:58

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.