6

The issue:

Let say I have a PPA for a software (i.e. Blender for example; http://ppa.launchpad.net/thomas-schiex/blender/ubuntu ) that contains for some reasons, a Python3.6 version.

What I want to achieve:

Let say I want "a better" Python3.6 package, for example from a python dedicated ppa, in my case; http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu

The question:

How does apt chose which package to install and is there a way I can tell apt to install it from one desired ppa upon the others?
I guess it will chose the most up-to-date package (am I wrong?), but what if for some reasons I want to keep a specific older version?

The example with python3.6 is "only" an example here, this may be useful for any packages.

Note about the dupplicate:
Even if the answer in the suggested links in the comments are the same, the entry points, i.e. "the question" is note exactly the same and lots of people may come to the answer through this search result instead of the other. So, in my humble opinion and strictly speaking, the answer is somewhat a dupplicate, not the question.

s.k
  • 1,490

1 Answers1

7

As you guessed apt is going to install the latest version available in your sources.

For example:

$ apt-cache madison firefox

   firefox | 61.0.1+build1-0ubuntu0.18.04.1 | http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
   firefox | 61.0.1+build1-0ubuntu0.18.04.1 | http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
   firefox | 59.0.2+build1-0ubuntu1 | http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages

As you can see there are two different version of Firefox available for me to install, let's check which one is going to be installed:

$ apt-cache policy firefox | head -3
firefox:
  Installed: (none)
  Candidate: 61.0.1+build1-0ubuntu0.18.04.1

As you can see the latest version is going to be installed (it's the candidate for installation)

You can use:

sudo apt install package-name=version

for example:

sudo apt install firefox=59.0.2+build1-0ubuntu1

to install an older version of a software.

As an alternative to pining , you can apt-mark to stop it from being upgraded:

sudo apt-mark hold firefox
Ravexina
  • 57,256