Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Explain me backports situation

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
doyab
Posts: 2
Joined: 2018-10-21 10:40

Explain me backports situation

#1 Post by doyab »

Hello,
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 ?

cronoik
Posts: 310
Joined: 2015-05-20 21:17

Re: Explain me backports situation

#2 Post by cronoik »

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
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!

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Explain me backports situation

#3 Post by debiman »

since virtualbox isn't in stable's repos, there's no ambiguity - the backports package is the only 1 to install.

doyab
Posts: 2
Joined: 2018-10-21 10:40

Re: Explain me backports situation

#4 Post by doyab »

Thanks for help :)

jmgibson1981
Posts: 299
Joined: 2015-06-07 14:38
Has thanked: 11 times
Been thanked: 32 times

Re: Explain me backports situation

#5 Post by jmgibson1981 »

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

Post Reply