Unable to update all software through command line

I am on Ubuntu Studio 26.04 which uses KDE.

When I do sudo apt-get update and then sud0 apt-get upgrade, it does not update all software on the system. From I remember it used to.

When I go into Discover, it shows software updates, and everything gets updated through there. What is the command line option to update all software on the system via command line, instead of using discover?

Are you talking about phased updates? It is normal that they are held back for a time. It’s literally random, who gets them first.

Well
apt-get is not really recommended for interactive use these days.

Try running these commands:

sudo apt update

If no errors, then either sudo apt upgrade to upgrade existing packages or sudo apt full-upgrade to upgrade existing and pull in new packages (when relevant).

2 Likes

One crucial side effect is that it is allowed to remove packages, if necessary to satisfy new dependencies. On a standard Ubuntu system that shouldn’t matter too much, because such only tend to change between distribution releases, but I have been bitten by this in the past, when not paying close attention to the list of packages to be removed; ended up having to fix my network by hand because NetworkManager was among the “victims”. But then again, I also wasn’t running a standard system. :innocent:

1 Like

That is a very good point and thanks for mentioning it.

@robertsaron my bad, make sure you always look at what is about to be removed before typing y.

I would like to add that it has never been the case that “all software” is updated.

The process checks what packages we have installed on our system. Then there is a check to determine which of those packages have upgraded packages available. Then we are informed what upgraded packages are available. When we confirm that we want those packages to be down loaded and installed, the utility goes ahead and does it.

This is what I see when I use the command line to update/upgrade. A GUI utility follows the same process.

Are you suggesting that package removals with full-upgrade only happen between major Ubuntu releases? Because that isn’t true at all on a standard Ubuntu system. Packages do get removed during full-upgrade and that’s fine.

When running full-upgrade, users may get a new kernel, which comprises multiple deb packages to install/upgrade. The older kernel packages will be removed (rightly) on a standard Ubuntu system.

Observe:

$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  aardvark-dns buildah catatonit conmon containernetworking-plugins crun fuse-overlayfs golang-github-containers-common
  golang-github-containers-image linux-headers-6.8.0-110 linux-headers-6.8.0-90 linux-tools-6.8.0-110 linux-tools-6.8.0-90
  netavark passt slirp4netns
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED
  linux-headers-6.8.0-90-generic linux-image-6.8.0-90-generic linux-modules-6.8.0-90-generic linux-modules-extra-6.8.0-90-generic
  linux-tools-6.8.0-90-generic
The following NEW packages will be installed
  linux-headers-6.8.0-124 linux-headers-6.8.0-124-generic linux-image-6.8.0-124-generic linux-modules-6.8.0-124-generic
  linux-modules-extra-6.8.0-124-generic linux-tools-6.8.0-124 linux-tools-6.8.0-124-generic
The following upgrades have been deferred due to phasing:
  apparmor firmware-sof-signed libapparmor1
The following packages will be upgraded:
  bind9-dnsutils bind9-host bind9-libs cloud-init dnsutils evince evince-common ffmpeg fonts-opensymbol google-chrome-stable
  gstreamer1.0-gtk3 gstreamer1.0-plugins-good gstreamer1.0-pulseaudio libarchive13t64 libavcodec60 libavdevice60 libavfilter9
  libavformat60 libavutil58 libcaca0 libevdocument3-4t64 libevview3-3t64 libgcrypt20 libgcrypt20:i386 libgnutls30t64
  libgstreamer-plugins-good1.0-0 libipa-hbac0t64 libldb2 liblzma-dev liblzma5 liblzma5:i386 libnss-sss libpam-sss libpostproc57
  libqt5qml5 libqt5qmlmodels5 libqt5qmlworkerscript5 libqt5quick5 libqt5quicktest5 libqt5quickwidgets5 libqt5webengine-data
  libqt5webengine5 libqt5webenginecore5 libqt5webenginewidgets5 libreoffice-base-core libreoffice-calc libreoffice-common
  libreoffice-core libreoffice-draw libreoffice-gnome libreoffice-gtk3 libreoffice-help-common libreoffice-help-en-gb
  libreoffice-help-en-us libreoffice-impress libreoffice-l10n-en-gb libreoffice-l10n-en-za libreoffice-math
  libreoffice-style-breeze libreoffice-style-colibre libreoffice-style-elementary libreoffice-style-yaru libreoffice-uiconfig-calc
  libreoffice-uiconfig-common libreoffice-uiconfig-draw libreoffice-uiconfig-impress libreoffice-uiconfig-math
  libreoffice-uiconfig-writer libreoffice-writer libsmbclient0 libssh2-1t64 libsss-certmap0 libsss-idmap0 libsss-nss-idmap0
  libswresample4 libswscale7 libuno-cppu3t64 libuno-cppuhelpergcc3-3t64 libuno-purpenvhelpergcc3-3t64 libuno-sal3t64
  libuno-salhelpergcc3-3t64 libwbclient0 libwww-perl linux-generic linux-headers-generic linux-image-generic linux-libc-dev
  linux-tools-common openvpn python3-ldb python3-pip-whl python3-samba python3-sss python3-uno python3-urllib3
  qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings qml-module-qtqml qml-module-qtqml-models2
  qml-module-qtquick-layouts qml-module-qtquick-window2 qml-module-qtquick2 qml-module-qttest qml-module-qtwebengine qmlscene
  qtdeclarative5-dev-tools rsync samba samba-ad-provision samba-common samba-common-bin samba-dsdb-modules samba-libs
  samba-vfs-modules snapd sssd sssd-ad sssd-ad-common sssd-common sssd-ipa sssd-krb5 sssd-krb5-common sssd-ldap sssd-proxy
  syncthing tailscale uno-libs-private ure vim vim-common vim-runtime vim-tiny xdg-desktop-portal xxd xz-utils
135 to upgrade, 7 to newly install, 5 to remove and 3 not to upgrade.
31 esm-apps security updates
Need to get 644 MB of archives.
After this operation, 115 MB of additional disk space will be used.
Do you want to continue? [Y/n]

The important bit:

135 to upgrade, 7 to newly install, 5 to remove and 3 not to upgrade.

The ‘5 to remove’ are just kernel packages, so we don’t end up with a full /boot.

The following packages will be REMOVED
  linux-headers-6.8.0-90-generic
  linux-image-6.8.0-90-generic
  linux-modules-6.8.0-90-generic
  linux-modules-extra-6.8.0-90-generic
  linux-tools-6.8.0-90-generic
The following NEW packages will be installed
  linux-headers-6.8.0-124
  linux-headers-6.8.0-124-generic
  linux-image-6.8.0-124-generic
  linux-modules-6.8.0-124-generic
  linux-modules-extra-6.8.0-124-generic
  linux-tools-6.8.0-124
  linux-tools-6.8.0-124-generic

So here we are on a pretty standard system, running the reccommended update commands (sudo apt update followed by sudo apt full-upgrade) and it removed packages that should be removed.

I am highlighting this because we absolutely shouldn’t be discouraging people from running full-upgrade. I see people doing apt upgrade all the time, not realising they’re missing out on package upgrades, and breaking their system.

3 Likes

Well, yes, when a meta package gets updated and the old dependencies aren’t needed anymore, they will get removed; nothing apt autoremove wouldn’t. Since my mishap with full-upgrade removing network-manager on a 22.04/24.04 hybrid, I only run apt upgrade and usually only the latest kernel and the one installed before that is kept, for each HWE and GA. As the apt(1) man page says:

(emphasis added)
Those kernel removals in your example are probably just the usual cleanup of old kernels; which is configured somewhere in /etc/apt/apt.conf.d/, IIRC. full-upgrade used to be called dist-upgrade and still is in apt-get, because a distro upgrade from one Debian stable to the next is usually when a package can have its dependencies changed in a major way so that it wouldn’t install with upgrade because it isn’t allowed to remove package which the new version has a Conlflicts: against; or more complex inter-dependencies the APT solver can’t otherwise satisfy. For instance, the standard mail transport agent now is postfix as opposed to exim4, but there was a transitional package, IIRC, which would only successfully install with full-upgrade, because it conflicted exim4, which regular upgrade isn’t allowed to satisfy, because it would have had to remove exim4.

That network-manager incident was ultimately caused by the transition to netplan as the net config backend and my system, which started from a bare bones server install was matched against the server criteria, even though it pretty much is a desktop, but I may have missed some packages which the auto detection was relying on, or something like that; I may be wrong on some details but that’s the gist I remember. And my system wasn’t exactly standard because, as I said, it was a 22.04/24.04 hybrid, with select packages from 24.04, made possible by APT pinning — yes, I knew what I was doing :wink: ; maybe it was simply because it wasn’t do-release-upgrade doing it, but plain apt because of that setup.
To be perfectly clear, that was my own fault; I should have read more closely the list of to be removed packages, but since such never happens on a day-to-day basis intra-release, I had gotten careless. It used to be quite common on Debian Sid, when I was still running it, but that comes with the territory, so I was more aware.

That sort of stuff shouldn’t happen on a standard Ubuntu system, simply because policy forbids major version upgrades, except for the HWE stack, which I have never seen to do a dependency switcheroo of Conflicts: old-dep && Depends: new-dep.

I did some more digging, and discover will show Flatpak upgrades, where as CLI will not. In order for CLI to show flatpak upgrades, you have to run the following command: flatpak update

CLI will then show the upgrades, and you can do the updates from there if you want.