Explain me backports situation

New to Debian (Or Linux in general)? Ask your questions here!

Explain me backports situation

Postby doyab » 2018-10-21 10:54

I’m new Debian user. I was using Fedora, this week i switched to Debian Stretch. I have question how backports work.

I'm using Debian Stretch, i wanted to install VirtualBox. I fallowed instructions on Debian Wiki and i added stretch backports (contrib) to /etc/apt/sources.list
I did apt-get update and apt-get install virtualbox. And virtualbox is installed on my system. But now i have question.

How my system knows when to use backports when not ? To install virtaulbox i didn't specify anything, i just did "apt-get install". So when i do apt-get install chromium how system decides from where to pick that package ? from backports or from regular repo. Virtualbox is understandable, it not exist in regular repo, so it's picked from backports, but what about other packages which exist in both, regular and backports repos ?
Posts: 2
Joined: 2018-10-21 10:40

Re: Explain me backports situation

Postby cronoik » 2018-10-21 11:49

You can always check which package is going to be installed with the command:
Code: Select all
apt-cache policy PACKAGE

For example libreoffice:
Code: Select all
 apt-cache policy libreoffice
  Installed: 1:5.2.7-1+deb9u4
  Candidate: 1:5.2.7-1+deb9u4
  Version table:
     1:6.1.3~rc1-1~bpo9+1 100
        100 http://ftp.de.debian.org/debian stretch-backports/main amd64 Packages
 *** 1:5.2.7-1+deb9u4 500
        500 http://ftp.de.debian.org/debian stretch/main amd64 Packages
        500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
        100 /var/lib/dpkg/status

As you can see I'm using the libreoffice of the stable repository. When I purge libreoffice and try to install it again without specifiying the repository, I would get also the libreoffice from the stable repository. apt chooses the repository based on there priorities (500 for stable and just 100 for backports). Each repository has it's priority which you can check with apt-cache policy. You can modify the priority of a package or a whole repository with apt-pinning. Check
Code: Select all
man apt_pinning

for further information.
Have a nice day!
Posts: 310
Joined: 2015-05-20 21:17

Re: Explain me backports situation

Postby debiman » 2018-10-21 12:56

since virtualbox isn't in stable's repos, there's no ambiguity - the backports package is the only 1 to install.
User avatar
Posts: 3064
Joined: 2013-03-12 07:18

Re: Explain me backports situation

Postby doyab » 2018-10-21 14:24

Thanks for help :)
Posts: 2
Joined: 2018-10-21 10:40

Re: Explain me backports situation

Postby jmgibson1981 » 2018-10-22 16:09

Also, for packages that are in both you need to specify which repo to pull from like so

Code: Select all
apt install -t stretch-backports $PACKAGE
Posts: 86
Joined: 2015-06-07 14:38

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 12 guests