You are not logged in.

#1 2021-05-17 07:16:01

b197rt
Member
Registered: 2020-08-03
Posts: 19

[SOLVED] Apt Upgrade Question

If I run 'apt update' it is reporting that all packages are up to date.  However if I comment out the sources in /etc/apt/sources.list it seems to poll the sources in /etc/apt/sources.list.d/ and shows updates available.

I have not modified anything except for enabling the backports.  Should I go ahead and run the upgrade with the the main sources commented out or will this risk breakage?

Last edited by b197rt (2021-06-23 04:41:58)

Offline

#2 2021-05-17 08:47:41

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,352
Website

Re: [SOLVED] Apt Upgrade Question

Sounds very contradictory, so I can't guess what is going on, what is the output of

grep -r --include '*.list' '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/

?

Offline

#3 2021-05-17 08:57:59

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 8,156
Website

Re: [SOLVED] Apt Upgrade Question

Maybe without the main repositories enabled, the backports are getting their pin number pushed from 100 to 500? If that's so, upgrading would mean upgrading all your packages to the backports version, not necessarily what you want.

Try running 'apt-cache policy' in the two situations, with and without the main sources.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#4 2021-05-17 09:01:43

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,352
Website

Re: [SOLVED] Apt Upgrade Question

^Great guess.

Offline

#5 2021-05-17 11:25:37

b197rt
Member
Registered: 2020-08-03
Posts: 19

Re: [SOLVED] Apt Upgrade Question

Here are the results of grep:

/etc/apt/sources.list.d/bunsen.list:deb http://pkg.bunsenlabs.org/debian lithium main
/etc/apt/sources.list.d/bunsen-buster-backports.list:deb https://pkg.bunsenlabs.org/debian buster-backports main
/etc/apt/sources.list.d/teamviewer.list:deb https://linux.teamviewer.com/deb stable main
/etc/apt/sources.list.d/debian-buster-backports.list:deb https://deb.debian.org/debian buster-backports main contrib non-free

and the result of apt-cache policy:

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 https://linux.teamviewer.com/deb stable/main amd64 Packages
     release o=TeamViewer GmbH,a=stable,l=TeamViewer,c=main,b=amd64
     origin linux.teamviewer.com
 100 https://deb.debian.org/debian buster-backports/non-free amd64 Packages
     release o=Debian Backports,a=buster-backports,n=buster-backports,l=Debian Backports,c=non-free,b=amd64
     origin deb.debian.org
 100 https://deb.debian.org/debian buster-backports/contrib amd64 Packages
     release o=Debian Backports,a=buster-backports,n=buster-backports,l=Debian Backports,c=contrib,b=amd64
     origin deb.debian.org
 100 https://deb.debian.org/debian buster-backports/main amd64 Packages
     release o=Debian Backports,a=buster-backports,n=buster-backports,l=Debian Backports,c=main,b=amd64
     origin deb.debian.org
 500 http://pkg.bunsenlabs.org/debian lithium/main amd64 Packages
     release o=bunsenlabs,a=lithium,n=lithium,l=bunsenlabs,c=main,b=amd64
     origin pkg.bunsenlabs.org
 100 https://pkg.bunsenlabs.org/debian buster-backports/main amd64 Packages
     release o=bunsenlabs,a=buster-backports,n=buster-backports,l=bunsenlabs,c=main,b=amd64
     origin pkg.bunsenlabs.org
 500 https://deb.debian.org/debian buster-updates/main amd64 Packages
     release o=Debian,a=stable-updates,n=buster-updates,l=Debian,c=main,b=amd64
     origin deb.debian.org
 500 https://deb.debian.org/debian-security buster/updates/non-free amd64 Packages
     release v=10,o=Debian,a=stable,n=buster,l=Debian-Security,c=non-free,b=amd64
     origin deb.debian.org
 500 https://deb.debian.org/debian-security buster/updates/main amd64 Packages
     release v=10,o=Debian,a=stable,n=buster,l=Debian-Security,c=main,b=amd64
     origin deb.debian.org
 500 https://deb.debian.org/debian buster/contrib amd64 Packages
     release v=10.9,o=Debian,a=stable,n=buster,l=Debian,c=contrib,b=amd64
     origin deb.debian.org
 500 https://deb.debian.org/debian buster/non-free amd64 Packages
     release v=10.9,o=Debian,a=stable,n=buster,l=Debian,c=non-free,b=amd64
     origin deb.debian.org
 500 https://deb.debian.org/debian buster/main amd64 Packages
     release v=10.9,o=Debian,a=stable,n=buster,l=Debian,c=main,b=amd64
     origin deb.debian.org
Pinned packages:

Offline

#6 2021-05-18 02:37:51

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 8,156
Website

Re: [SOLVED] Apt Upgrade Question

Thanks.
Could you comment-out the main repos, as you had before, then run 'sudo apt update; apt-cache policy' and post it?
(Don't run apt-get upgrade!)


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#7 2021-05-22 20:17:57

b197rt
Member
Registered: 2020-08-03
Posts: 19

Re: [SOLVED] Apt Upgrade Question

Here is apt update:

sudo apt update
Hit:2 https://deb.debian.org/debian buster-backports InRelease                 
Hit:3 https://linux.teamviewer.com/deb stable InRelease                        
Hit:1 http://eu.pkg.bunsenlabs.org/debian lithium InRelease                    
Hit:5 https://eu.pkg.bunsenlabs.org/debian buster-backports InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
148 packages can be upgraded. Run 'apt list --upgradable' to see them.

and apt-cache policy:

sudo apt-cache policy 
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 https://linux.teamviewer.com/deb stable/main i386 Packages
     release o=TeamViewer GmbH,a=stable,l=TeamViewer,c=main,b=i386
     origin linux.teamviewer.com
 500 https://linux.teamviewer.com/deb stable/main amd64 Packages
     release o=TeamViewer GmbH,a=stable,l=TeamViewer,c=main,b=amd64
     origin linux.teamviewer.com
 100 https://deb.debian.org/debian buster-backports/non-free i386 Packages
     release o=Debian Backports,a=buster-backports,n=buster-backports,l=Debian Backports,c=non-free,b=i386
     origin deb.debian.org
 100 https://deb.debian.org/debian buster-backports/non-free amd64 Packages
     release o=Debian Backports,a=buster-backports,n=buster-backports,l=Debian Backports,c=non-free,b=amd64
     origin deb.debian.org
 100 https://deb.debian.org/debian buster-backports/contrib i386 Packages
     release o=Debian Backports,a=buster-backports,n=buster-backports,l=Debian Backports,c=contrib,b=i386
     origin deb.debian.org
 100 https://deb.debian.org/debian buster-backports/contrib amd64 Packages
     release o=Debian Backports,a=buster-backports,n=buster-backports,l=Debian Backports,c=contrib,b=amd64
     origin deb.debian.org
 100 https://deb.debian.org/debian buster-backports/main i386 Packages
     release o=Debian Backports,a=buster-backports,n=buster-backports,l=Debian Backports,c=main,b=i386
     origin deb.debian.org
 100 https://deb.debian.org/debian buster-backports/main amd64 Packages
     release o=Debian Backports,a=buster-backports,n=buster-backports,l=Debian Backports,c=main,b=amd64
     origin deb.debian.org
 500 http://pkg.bunsenlabs.org/debian lithium/main i386 Packages
     release o=bunsenlabs,a=lithium,n=lithium,l=bunsenlabs,c=main,b=i386
     origin pkg.bunsenlabs.org
 500 http://pkg.bunsenlabs.org/debian lithium/main amd64 Packages
     release o=bunsenlabs,a=lithium,n=lithium,l=bunsenlabs,c=main,b=amd64
     origin pkg.bunsenlabs.org
 100 https://pkg.bunsenlabs.org/debian buster-backports/main i386 Packages
     release o=bunsenlabs,a=buster-backports,n=buster-backports,l=bunsenlabs,c=main,b=i386
     origin pkg.bunsenlabs.org
 100 https://pkg.bunsenlabs.org/debian buster-backports/main amd64 Packages
     release o=bunsenlabs,a=buster-backports,n=buster-backports,l=bunsenlabs,c=main,b=amd64
     origin pkg.bunsenlabs.org
Pinned packages:

Offline

#8 2021-05-25 02:37:51

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 8,156
Website

Re: [SOLVED] Apt Upgrade Question

Thanks @b197rt.

We can see here that the backports are still pinned at 100, even with Debian main repo commented out, not 500 as I speculated.

Anyway, to answer your original question: "Should I go ahead and run the upgrade with the the main sources commented out?" my answer is no. There is no reason I'm aware of to run a Debian system with the main sources commented-out, and some reasons I can think of (eg missed security updates) not to do so.

---
If you're interested in getting to the bottom of why apt wants to upgrade 148 packages in that situation (I'm curious too) then just pick one of the packages in the list you get by running

apt list --upgradable

and run this command:

apt-cache policy <packagename>

substituting the name of the package you chose.
That should tell us why apt wants to upgrade it.

For comparison, you could re-enable the main Debian repo, then run again:

sudo apt update
apt-cache policy <packagename>

with the same package.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#9 2021-05-27 19:19:12

b197rt
Member
Registered: 2020-08-03
Posts: 19

Re: [SOLVED] Apt Upgrade Question

Okay @johnraff, I apologize but I already ran an apt upgrade before seeing your message but here are my results:

With the main repos commented out and the package 'cryptsetup-bin' chosen, I get this result:

 sudo apt-cache policy cryptsetup-bin 
cryptsetup-bin:
  Installed: 2:2.1.0-5+deb10u2
  Candidate: 2:2.1.0-5+deb10u2
  Version table:
     2:2.3.5-1~bpo10+1 100
        100 https://deb.debian.org/debian buster-backports/main amd64 Packages
 *** 2:2.1.0-5+deb10u2 500
        500 https://deb.debian.org/debian buster/main amd64 Packages
        100 /var/lib/dpkg/status

With the repos re-enabled I get the following result (--list-upgradable says that nothing is upgradable):

sudo apt-cache policy cryptsetup-bin
cryptsetup-bin:
  Installed: 2:2.1.0-5+deb10u2
  Candidate: 2:2.3.5-1~bpo10+1
  Version table:
     2:2.3.5-1~bpo10+1 100
        100 https://deb.debian.org/debian buster-backports/main amd64 Packages
 *** 2:2.1.0-5+deb10u2 100
        100 /var/lib/dpkg/status

Offline

#10 2021-05-27 21:55:23

hhh
Meep!
Registered: 2015-09-17
Posts: 12,021
Website

Re: [SOLVED] Apt Upgrade Question

^ If you targeted the backports repo, cryptsetup-bin would get upgraded. I would target cryptsetup itself, though, in this instance..

sudo apt install -t buster-backports cryptsetup

https://packages.debian.org/buster-backports/cryptsetup

If, like me, you don't use encrypted partitions, you can delete the packages...

sudo apt purge cryptsetup* && sudo apt --purge autoremove

Thanks for reminding me, I hadn't done that on my latest install yet!

Offline

#11 2021-05-28 02:22:25

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 8,156
Website

Re: [SOLVED] Apt Upgrade Question

Why this was happening was the original question:

b197rt wrote:

if I comment out the sources in /etc/apt/sources.list it seems to poll the sources in /etc/apt/sources.list.d/ and shows updates available.

---
Now, this shows that the backports version (2:2.3.5-1~bpo10+1) of cryptsetup-bin is not a candidate for upgrade:
(By the way, there's no need to use 'sudo' with 'apt-cache policy'.)

b197rt wrote:

With the main repos commented out and the package 'cryptsetup-bin' chosen, I get this result:

 sudo apt-cache policy cryptsetup-bin 
cryptsetup-bin:
  Installed: 2:2.1.0-5+deb10u2
  Candidate: 2:2.1.0-5+deb10u2
  Version table:
     2:2.3.5-1~bpo10+1 100
        100 https://deb.debian.org/debian buster-backports/main amd64 Packages
 *** 2:2.1.0-5+deb10u2 500
        500 https://deb.debian.org/debian buster/main amd64 Packages
        100 /var/lib/dpkg/status

What's more, the buster/main line shows that your main repos are not commented out! Maybe you didn't run 'sudo apt update' (not upgrade) before checking the policy? You have to run an update after editing sources in order for the results to be recognized.

Do you still have some packages reported as having upgrades available when the main repos are commented out? If not, I guess there's nothing more to search for...

---
Meanwhile, this again suggests to me that you didn't do an 'apt update' after restoring the main repos. There should be a line referring to the main repos:

With the repos re-enabled I get the following result (--list-upgradable says that nothing is upgradable):

sudo apt-cache policy cryptsetup-bin
cryptsetup-bin:
  Installed: 2:2.1.0-5+deb10u2
  Candidate: 2:2.3.5-1~bpo10+1
  Version table:
     2:2.3.5-1~bpo10+1 100
        100 https://deb.debian.org/debian buster-backports/main amd64 Packages
 *** 2:2.1.0-5+deb10u2 100
        100 /var/lib/dpkg/status

On my system it looks like this:

john@lithium:~$ apt-cache policy cryptsetup-bin
cryptsetup-bin:
  Installed: (none)
  Candidate: 2:2.1.0-5+deb10u2
  Version table:
     2:2.3.5-1~bpo10+1 100
        100 https://deb.debian.org/debian buster-backports/main amd64 Packages
     2:2.1.0-5+deb10u2 500
        500 https://deb.debian.org/debian buster/main amd64 Packages

See the buster/main line?


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#12 2021-05-28 18:56:59

b197rt
Member
Registered: 2020-08-03
Posts: 19

Re: [SOLVED] Apt Upgrade Question

@johnraff, I thought I did do an 'apt update' before 'apt-cache policy'.  Nonetheless I redid what you have asked, disabling the main repos, running an update and then apt-cache policy.  I redirected all the output to a file.

# 

# deb cdrom:[Debian GNU/Linux 10 _Lithium_ - Snapshot amd64 LIVE/INSTALL Binary 20210130-13:51]/ buster contrib main non-free

#deb cdrom:[Debian GNU/Linux 10 _Lithium_ - Snapshot amd64 LIVE/INSTALL Binary 20210130-13:51]/ buster contrib main non-free

###deb https://deb.debian.org/debian buster main non-free contrib
# deb-src https://deb.debian.org/debian buster main non-free contrib

## Debian security updates
###deb https://deb.debian.org/debian-security buster/updates main contrib non-free

# buster-updates, previously known as 'volatile'
###deb https://deb.debian.org/debian buster-updates main contrib non-free
# deb-src https://deb.debian.org/debian buster-updates main contrib non-free

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
Hit:1 http://download.opensuse.org/repositories/home:/jgeboski/Debian_10 ./ InRelease
Hit:3 https://deb.debian.org/debian buster-backports InRelease
Hit:4 https://linux.teamviewer.com/deb stable InRelease
Hit:2 http://eu.pkg.bunsenlabs.org/debian lithium InRelease
Hit:5 https://eu.pkg.bunsenlabs.org/debian buster-backports InRelease
Reading package lists...
Building dependency tree...
Reading state information...
149 packages can be upgraded. Run 'apt list --upgradable' to see them.
cryptsetup-bin:
  Installed: 2:2.1.0-5+deb10u2
  Candidate: 2:2.3.5-1~bpo10+1
  Version table:
     2:2.3.5-1~bpo10+1 100
        100 https://deb.debian.org/debian buster-backports/main amd64 Packages
 *** 2:2.1.0-5+deb10u2 100
        100 /var/lib/dpkg/status

I'm noticing that the policy for cryptsetup-bin has changed, maybe I didn't follow your instructions the first time.  I apologize, what does this result tell you?

Last edited by b197rt (2021-05-28 18:58:48)

Offline

#13 2021-05-29 00:13:53

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 8,156
Website

Re: [SOLVED] Apt Upgrade Question

^OK this says that with the main repos disabled, the installed cryptsetup-bin (ver. 2:2.1.0-5+deb10u2) can be upgraded to the backports version (2:2.3.5-1~bpo10+1).

This come from pinning, which you'd need to search for and read up on a bit to understand fully, but for now:
*) packages in the "main" repository have a pin of 500
*) packages in backports have a pin of 100
*) packages installed on your system have a pin of 100

*) If two versions of a package have different pin numbers then the version with the higher pin gets priority.
*) If the two versions have the same pin, then the higher version gets priority.

So without the main repos, the backports cryptsetup-bin has priority over the installed version because both have pin 100 and the backports version is higher.

With the main repos enabled, then the main version, with its pin of 500, gets priority over the backports version, pin 100, even if the backports version is higher.

As I previously advised, the correct setup is to enable main, security and optionally updates and backports repositories. Backports will have a lower pin than main so will not be installed unless specifically called for, as @hhh explained:

sudo apt install -t buster-backports <packagename>

I hope that helps! smile


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#14 2021-05-29 00:59:03

hhh
Meep!
Registered: 2015-09-17
Posts: 12,021
Website

Re: [SOLVED] Apt Upgrade Question

johnraff wrote:

As I previously advised, the correct setup is to enable main, security and optionally updates and backports repositories. Backports will have a lower pin than main so will not be installed unless specifically called for, as @hhh explained:

sudo apt install -t buster-backports <packagename>

Please, enable them! I know this thread is all delving into how Debian/Linux works, but let's make it clear that running an OS with the main repos disabled is, to say the least, ill advised!

Offline

#15 2021-06-23 04:41:39

b197rt
Member
Registered: 2020-08-03
Posts: 19

Re: [SOLVED] Apt Upgrade Question

Hi all, I apologize for this being so late of a reply, I just wanted to say thank you for the informative and in-depth answers.

Offline

Board footer

Powered by FluxBB