13

If a PPA in your sources list has a package of the same name in the Ubuntu Software Center, which one shows up in the software center. Likewise, which package is downloaded via apt-get install ?

2 Answers 2

13

Package priority

The priorities of package sources is defined in the local package configuration.
This configuration can be inspected with apt-cache policy.

Here is an example of what apt-cache policy shows for the package git that is available in the Ubuntu main package repository, and in a PPA, and the PPA version is currently installed:

$ apt-cache policy git
git:
  Installed: 1:2.1.0-1~ppa0~ubuntu14.04.1
  Candidate: 1:2.1.0-1~ppa0~ubuntu14.04.1
  Version table:
 *** 1:2.1.0-1~ppa0~ubuntu14.04.1 0
        500 http://ppa.launchpad.net/git-core/ppa/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     1:1.9.1-1 0
        500 http://de.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

The numbers in front of the URLs specify the priority. The package from a source with the highest priority is preferred, if there is only one source with this priority.

Newer package of equal priority

If there are multiple entries of the highest priority, as it is the case here, the newer version is preferred.

Change priorities

To change the priorities to prefer a specific version, exceptions rules can be defined in /etc/apt/preferences. Locking a package to a fixed version is called "pinning".
See PinningHowto.

4

Whichever repo has the latest version of the package is the one shown in the Ubuntu Software center and downloaded with apt-get install. It is like this by default, but can be changed in the Software Repositories window.

2
  • 2
    Can you elaborate how to change the default behavior and into what it can be changed? Thanks!
    – Necktwi
    Sep 15, 2014 at 13:15
  • This is not completely correct, you can set priority of a source: help.ubuntu.com/community/PinningHowto
    – pomsky
    Jan 23, 2019 at 8:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .