How does YUM know which repository to use for installation if the same application is available in two repos?

Honey Badger asked:

EXAMPLE SCENARIO: Installing Nginx

I am installing Nginx. In order to get the latest repo, I download the RPM from the Nginx website. Like so:

rpm -Uvh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

Since I need to install PHP-FPM, I also downloaded a couple more repos from somewhere else, like so:

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm


rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Now the first repo also contains Nginx. So when I type:

yum install nginx

Which repo will YUM use to install Nginx?

Thanks!

My answer:


By default, you get the highest version of the package available in any enabled repository. The repository name is completely irrelevant.

Of course, various yum plugins such as priorities and versionlock can change which packages or package versions are available to you.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.