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,280
  • 2
    Volker Seigel's answer covers all questions here, I think. – muru Aug 15 '18 at 07:33
  • "lots of people may come to the answer through this search result instead of the other" - that's the whole point of duplicates. – muru Aug 16 '18 at 07:16
  • Yes and no. If you have one specific problem, like I did, you naturaly won't search for something other if you didn't faced it aswell, even if the answer is the same. That's why I didn't found the other threads; I had in mind the specific "double PPA" issue, nothing related to "one PPA and the software center". But the answer works for both, that's true. The problem with "answers" is that you don't already have them in mind when you face a problem! – s.k Aug 16 '18 at 08:42
  • so ... you agree that closing this as a duplicate will only help people who have different conceptions of the same problem? After all 2 PPAs or 1 PPA and 1 software center - both are just two software sources. – muru Aug 16 '18 at 08:46
  • @muru that the answer on that question solves this one, doesn't mean that it is the correct duplicate. I used instead the question that asks what OP asks about and also have the answers that would solve OP issue. – Braiam Aug 16 '18 at 11:46
  • @Braiam that's not my reasoning here. – muru Aug 16 '18 at 11:47
  • @muru still, wrong duplicate. If it was the correct one, OP wouldn't complain. If it's complaining is because your actions were unsatisfying of the OP's question. That makes everything that follows an inadequate solution. Make sure that if you are closing a question as duplicate, both questions will have the same set of answers. – Braiam Aug 16 '18 at 11:49
  • @Braiam in my experience, plenty of OPs take offense simply at the suggestion that their question could be a duplicate. – muru Aug 16 '18 at 11:53
  • @muru but in this case, OP is right, and you should, as experience user that you call yourself, see past the saltiness of OP words and see their merit. I still decided not to close as duplicate of the question you link to, because I agree with OP that it isn't a duplicate of that question and for that I commented about. Yet still, I vote to close as duplicate of another question. – Braiam Aug 16 '18 at 17:04
  • @Braiam I disagree. Both questions are about the same thing, just that the OP of the other post called it "software center". Since you have already closed it, I'm not interested in carrying on this discussion. – muru Aug 16 '18 at 19:30

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
  • 55,668
  • 25
  • 164
  • 183