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

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

rpm -Uvh

rpm -Uvh

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

yum install nginx

Which repo will YUM use to install Nginx?


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 any other answers on Server Fault.

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