0

I´d like to have a question regarding new repos: In some cases, the versions of Ubuntu programms are outdated. Mostly, it is recommended to get newer versions by adding a repo of the other organisation.

Example: the free monitoring tool "Zabbix" in Ubuntu repos is maybe version 1.9. The latest stable version is 3.2, provided by a reposerver of the Zabbix project.

Let us assume, I have correctly added the Zabbix repo. When I install Zabbix via console, how does the system realize, NOT to download the older version? How does it realize, that there is a newer one, which is not in the official Ubuntu repos ? Do I have to give something with the command, in terms of "use the other, the new repo, but not ubuntu´s." ?

Thanks in advance.

Bhe
  • 31
  • 1
  • 3
  • 4
    A good read: https://askubuntu.com/questions/135339/assign-highest-priority-to-my-local-repository and another one https://linux.die.net/man/5/apt_preferences – Bruni Sep 21 '16 at 07:31
  • " NOT to download the older version" because the number 1 is lower than 2 is lower than 3 ... is lower than 9 ;-) – Rinzwind Sep 21 '16 at 07:46

1 Answers1

1

By default, apt always uses the newest version of a package.

When you run apt-get update, all available repositories are queried for a list of which packages they contain, and this list is downloaded. Then, when you run apt-get install somepackage, apt looks at the list(s) of all available packages, from all repositories, and chooses the newest available version.

When you install something with apt-get install, it will tell you exactly what version it's installing.

Jonas Czech
  • 4,017
  • "By default, apt always uses the newest version of a package" I would rephrase that. Let's say Ubuntu holds a version 2 and the PPA maintainer decides to keep the name but to renumber its software and start with 0.2. Even though the 0.2.1 version of that would be newer it would not install. Yeah stupid from the maintainer but it is possible ;-) "highest number" would be better. – Rinzwind Sep 21 '16 at 07:48