35

I've tried to sudo update and upgrade as usual but it displays

The following packages have been kept back:
  base-files python3-distupgrade python3-gi python3-gi-cairo
  ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

I've tried:

  • the normal procedure (sudo apt update and upgrade)
  • the apt-get procedure
  • sudo -i and performed the normal procedure -https://www.youtube.com/watch?v=Il_Za-wlW5I (whats in this video)
  • changing software updater and software and updates settings

(also tried restarting my laptop)

Before I tried mounting an usb and a sd card. While I tried this I didn't have a net connection at the time. I tried updating and of course it didn't work. After noticing and reconnecting I did install some updates but then it got stuck on that display

Full display: sudo apt update

[sudo] password for dcg: 
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7
dcg@dcg-IdeaPad-5-15ITL05:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  base-files python3-distupgrade python3-gi python3-gi-cairo
  ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

List of updates:

cg@dcg-IdeaPad-5-15ITL05:~$ apt list --upgradable
Listing... Done
base-files/jammy-updates 12ubuntu4.2 amd64 [upgradable from: 12ubuntu4.1]
python3-distupgrade/jammy-updates,jammy-updates 1:22.04.12 all [upgradable from: 1:22.04.11]
python3-gi-cairo/jammy-updates 3.42.1-0ubuntu1 amd64 [upgradable from: 3.42.0-3build1]
python3-gi/jammy-updates 3.42.1-0ubuntu1 amd64 [upgradable from: 3.42.0-3build1]
ubuntu-release-upgrader-core/jammy-updates,jammy-updates 1:22.04.12 all [upgradable from: 1:22.04.11]
ubuntu-release-upgrader-gtk/jammy-updates,jammy-updates 1:22.04.12 all [upgradable from: 1:22.04.11]

dcg@dcg-IdeaPad-5-15ITL05:~$ sudo apt update Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB] Get:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99,8 kB] Get:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB] Get:5 http://archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages [260 kB] Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [474 kB] Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [196 kB] Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/universe i386 Packages [102 kB] Fetched 1356 kB in 4s (386 kB/s)
Reading package lists... Done Building dependency tree... Done Reading state information... Done 6 packages can be upgraded. Run 'apt list --upgradable' to see them. W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7 W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7 dcg@dcg-IdeaPad-5-15ITL05:~$ sudo apt full-upgrade Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done The following packages have been kept back: base-files python3-distupgrade ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk The following packages will be upgraded: python3-gi python3-gi-cairo 2 upgraded, 0 newly installed, 0 to remove and 4 not upgraded. Need to get 237 kB of archives. After this operation, 1024 B of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-gi-cairo amd64 3.42.1-0ubuntu1 [8184 B] Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-gi amd64 3.42.1-0ubuntu1 [229 kB] Fetched 237 kB in 1s (410 kB/s)
(Reading database ... 215354 files and directories currently installed.) Preparing to unpack .../python3-gi-cairo_3.42.1-0ubuntu1_amd64.deb ... Unpacking python3-gi-cairo (3.42.1-0ubuntu1) over (3.42.0-3build1) ... Preparing to unpack .../python3-gi_3.42.1-0ubuntu1_amd64.deb ... Unpacking python3-gi (3.42.1-0ubuntu1) over (3.42.0-3build1) ... Setting up python3-gi (3.42.1-0ubuntu1) ... Setting up python3-gi-cairo (3.42.1-0ubuntu1) ...

(From here on out only 4 packages were not upgraded...I don't know how the other 2 upgraded)

Using sudo apt full-update:

dcg@dcg-IdeaPad-5-15ITL05:~$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99,8 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates/main i386 Packages [260 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [474 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [196 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy-updates/universe i386 Packages [102 kB]
Fetched 1356 kB in 4s (386 kB/s)                        
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7
W: Target Sources (restricted/source/Sources) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:7
dcg@dcg-IdeaPad-5-15ITL05:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  base-files python3-distupgrade ubuntu-release-upgrader-core
  ubuntu-release-upgrader-gtk
The following packages will be upgraded:
  python3-gi python3-gi-cairo
2 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Need to get 237 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-gi-cairo amd64 3.42.1-0ubuntu1 [8184 B]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 python3-gi amd64 3.42.1-0ubuntu1 [229 kB]
Fetched 237 kB in 1s (410 kB/s)    
(Reading database ... 215354 files and directories currently installed.)
Preparing to unpack .../python3-gi-cairo_3.42.1-0ubuntu1_amd64.deb ...
Unpacking python3-gi-cairo (3.42.1-0ubuntu1) over (3.42.0-3build1) ...
Preparing to unpack .../python3-gi_3.42.1-0ubuntu1_amd64.deb ...
Unpacking python3-gi (3.42.1-0ubuntu1) over (3.42.0-3build1) ...
Setting up python3-gi (3.42.1-0ubuntu1) ...
Setting up python3-gi-cairo (3.42.1-0ubuntu1) ...
Artur Meinild
  • 26,018
  • 1
    You've not provided any OS/release details (useful in understanding package issues), nor provided full text messages of your issue, thus we're rather limited in how we can help you. Assuming you've made no changes to default python3 packages, you should read all your messages for clues; starting with sudo apt update (ie. inappropriate sources for your unstated release) then the commands you mention. FYI: You do realize there are package upgrades that apt upgrade cannot perform; ie. why apt full-upgrade (or dist-upgrade) exist as per documentation. – guiverc Jul 31 '22 at 01:03
  • dcg@dcg-IdeaPad-5-15ITL05:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04 LTS Release: 22.04 Codename: jammy (i'll send the full text issue next) – David Graça Jul 31 '22 at 01:06
  • full display on the question now (edited) – David Graça Jul 31 '22 at 01:10
  • Did you try sudo apt full-upgrade ; read man apt to see the difference in the commands, ie. it'll report "full-upgrade performs the function of upgrade but will remove currently installed packages if this is needed to upgrade the system as a whole" ie. apt upgrade can leave some behind if removes are required. You can also list the packages so you can explore one to find out why specifically it's not being upgraded. – guiverc Jul 31 '22 at 01:13
  • I tried the first option but it failed. Will try the 2nd – David Graça Jul 31 '22 at 01:15
  • I checked the list of updates but nothing seems out of the ordinary... I've edited my question to include that section. – David Graça Jul 31 '22 at 01:18
  • What is the complete output of the command sudo apt full-upgrade? The complete command output needs to be copy-pasted into your question as an edit for us to start to see what's going on. Packages being held back suggests that you have something marked as held, but the output of full-upgrade is going to be important. – Thomas Ward Jul 31 '22 at 02:04
  • Alternatively, you can try sudo apt install base-files python3-distupgrade python3-gi python3-gi-cairo ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk which will install each package held back, but if that fails then we need the full output of that too because that'll help us figure out where your system is getting hung up. When was the last time updates succeeded on your system, and did you recently upgrade to 22.04 from an older release? – Thomas Ward Jul 31 '22 at 02:06
  • installing the base files is what solved the problem. Thank you so much for your help! – David Graça Jul 31 '22 at 02:09
  • @DavidGraça yeah, base-files had some updates that could be considered 'problematic' so sometimes forcing it to install directly helps. But yeah, don't pipe apt list --upgradeable output into apt install heh. – Thomas Ward Jul 31 '22 at 02:33
  • 3
  • There are no answers here, only speculation piled on top of the ill-reasoned decision to create a class of "held back" updates. You need read no further than the "explanation" provided here to see this; even the "details" referenced in the now-deleted blog post by Brian Murray are absent. Perhaps Brian came to his senses? – Seamus Sep 16 '22 at 19:18

3 Answers3

58

All four of the kept-back packages (base-files, python3-distupgrade, ubuntu-release-upgrader-core, ubuntu-release-upgrader-gtk) were in Phased Updates at the time you asked the question.

  • Phased Updates is one precaution to prevent everybody from receiving a buggy package via upgrade: Some people get the upgraded a few days earlier, others a few days later. This provides an opportunity to pause distribution if early folks report problems.

There is nothing wrong. Your system is NOT broken.

Do not try to force the upgrades. Apt will properly install each upgraded package automatically when your turn comes. Phasing typically runs a week or so. Simply run apt update and apt upgrade again in a few days.

  • Security upgrades are usually NOT phased. Everybody gets those immediately. The four packages in your question are phased, and therefore NOT security upgrades.

How to see Phased Updates:

$ apt policy base-files 
base-files:
  Installed: 12ubuntu4.1
  Candidate: 12ubuntu4.2
  Version table:
     12ubuntu4.2 500 (phased 60%) <------------ There it is!
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
 *** 12ubuntu4.1 100
        100 /var/lib/dpkg/status
     12ubuntu4 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

You can also see phased update status for some (not all) packages at https://people.canonical.com/%7Eubuntu-archive/phased-updates.html


How to skip phasing, jump to the head of the queue, and install the new package anyway:

Tell apt what you want using the -o (option) flag.

apt -o APT::Get::Always-Include-Phased-Updates=true upgrade
  • Jumping to the head of the queue is not recommended for most users. You're volunteering to be the tester; for any bugs to affect you first. Bugs in updates are rare, but they do occur.
user535733
  • 62,253
  • 3
    This is accurate. You might want to add that users can run apt -o APT::Get::Always-Include-Phased-Updates=true upgrade if they wish to receive updates earlier than the usual phasing. This is mostly safe - it just puts them at the front of the "queue" by bypassing the phasing. Though of course if the package turns out to have been a problem that they would have saved from by the phasing, then that won't happen. – Robie Basak Aug 05 '22 at 06:55
  • Thanks, @user535733, for the hint. I will try to issue a bug/spec on launchpad. – mfg Aug 22 '22 at 13:29
  • 2
    Thanks for providing some more details on this. I didn't even know this was even a thing in Ubuntu, as packages being held back in the past usually happened for other reasons. The last few weeks I've had this happen a lot, to the point where I thought it was a bug or some dependency problem. The fact that the message shown often used to mean something else in the past causes some unnecessary confusion.

    Preferably, the message shown would tell you the reason they were held back. :)

    – blunden Aug 25 '22 at 09:20
  • Given the amount of times this question has been asked and the different solutions (upgrade vs manual install vs phased updates) I wonder if it would be an improvement if the reason of why a package is held back would be displayed. – Anemoia Oct 20 '22 at 20:48
  • @Anemoia most discussion of Phased Updates occurring at https://discourse.ubuntu.com/t/phased-updates-in-apt-in-21-04/20345. Note that "reason why a package has been held back" has been mentioned." – user535733 Oct 20 '22 at 22:15
  • Would perhaps make a lot of sense to make that clear in the apt upgrade output? Currently very opaque that the reason for the held back packages is a phased upgrade. – Amos Folarin Nov 01 '22 at 22:19
  • @AmosFolarin this is the wrong place to make suggestions. Developers don't hang out here. We are fellow users like you. – user535733 Nov 02 '22 at 00:00
  • Old question but a good way to confirm if a package is held back due to a phased update is to run sudo apt policy package1 package2. Look for something like "(phased 20%)" under the "Version table" header (tested on Ubuntu 22.04.1). Also see this excellent piece of Ubuntu documentation: https://ubuntu.com/server/docs/about-apt-upgrade-and-phased-updates – sheng Apr 12 '23 at 03:48
  • @sheng your comment seems to duplicate the working example provided in this answer. Are you suggesting a change to the example? – user535733 Apr 12 '23 at 04:05
  • @user535733 Indeed, apparently I cannot read. As you were. – sheng Apr 12 '23 at 06:19
3

If you want to permanently opt-in to all phased upgrades in the future, you can create a conf file so that you don't have to add a long command-option each time you issue apt upgrade.

/etc/apt/apt.conf.d/30phased-upgrades

APT::Get::Always-Include-Phased-Updates "true";
iBug
  • 1,589
-1

I had a similar problem and I solved it installing the aptitude package and running the following command.

$ sudo aptitude update
$ sudo aptitude upgrade

Seeing some of the answers I don't know now if did wrong and got that buggy package, but my computer works perfect at the moment, and I never had the same issue again.

Artur Meinild
  • 26,018
  • 2
    This particular "issue" was actually the system working properly. While you can indeed haywire your system to force/bypass/disable Phased Updates, it's a bad idea for most users. – user535733 Aug 17 '22 at 02:21
  • 1
    Does that means that I should not use the aptitude package for updating and upgrading? What problems could I have due to this? As fur as I know is more advanced than apt and dpkg, and that's the only thing I did, I didn't touch any internal thing from the system. – Dcodewin Aug 18 '22 at 10:18
  • 1
    Aptitude is not "more advanced"; it's just "different". Some people like it, some people don't. Aptitude is the recommended package manager for Debian, while apt is the recommended package manager for Ubuntu. Neither is better or worse than the other. Use the one that you understand best, and that does not break your system. – user535733 Aug 18 '22 at 16:41
  • Thank you very much for all the info. I didn't know that. So in this case, is using aptitude on Ubuntu considered haywire the system? Which might be the consequences for most users if something goes wrong? – Dcodewin Aug 23 '22 at 23:36
  • Your answer strikes me as equally valid compared to the others here. The other answer ultimately falls back on speculation to explain what seems an amazingly ill-considered "feature". This "kept back" business seems unnecessary, and a "bad Ubuntu idea"; at least your answer spares us the hand-waving & hyperbole. – Seamus Sep 16 '22 at 19:24