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

 

 

 

why do I have to run "apt dist-upgrade" twice?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
axkibe
Posts: 14
Joined: 2013-11-28 07:28

why do I have to run "apt dist-upgrade" twice?

#1 Post by axkibe »

I just noticed when upgrading a forgotten system running buster to bullseye.. After changing /etc/apt/sources from buster to bullseye I run "apt update" then "apt dist-upgrade".. everything works smoothly (on this machine), but running "apt dist-upgrade" immediately another times updates some more packages.

It's no biggie and a behaviour I got used to, but why?

Is this by design or an oversight of apt?

Random_Troll
Posts: 444
Joined: 2023-02-07 13:35
Been thanked: 105 times

Re: why do I have to run "apt dist-upgrade" twice?

#2 Post by Random_Troll »

The general recommendation has been to first use 'apt upgrade' then use 'apt dist-upgrade' afterwards. I think if you only use dist-upgrade then the packages can't be removed on the first round, possibly because of circular dependencies (but that's just a guess).

See https://www.debian.org/releases/testing ... al-upgrade for the current bookworm guidance.
Jeder nach seinen Fähigkeiten, jedem nach seinen Bedürfnissen.

arochester
Emeritus
Emeritus
Posts: 2435
Joined: 2010-12-07 19:55
Has thanked: 14 times
Been thanked: 54 times

Re: why do I have to run "apt dist-upgrade" twice?

#3 Post by arochester »

I think it has to do with dependencies.

At the first upgrade some packages can't be updated until their dependencies are updated.

At the second upgrade those packages can be updated because their dependencies have been updated.

CwF
Global Moderator
Global Moderator
Posts: 2636
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: why do I have to run "apt dist-upgrade" twice?

#4 Post by CwF »

I used to drop down the method to aptitude or cli but for upgrades to bookworm I've used synaptic without issue. After the sources.list update it's done in one step. It helps to use a single repo while upgrading and take care of the casualties later. If everything is in the one official repo it's butter smooth.

If you watch the log of the upgrade you'll see it iterates many times to get it done. Logged out of any desktop in a root tty it needs to iterate fewer times.

Post Reply