safe to use "apt purge '~o'" after upgrade?

olivluca

New Member
Nov 26, 2024
10
2
3
The standard debian upgrade procedure recommends to purge obsolete packages after a dist-upgrade, but the proxmox upgrade guide doesn't. Is it safe?
Some are old libraries, some are old kernels and both mime-support and spl are dummy/transitional packages, so it should be safe to remove them but I prefer to ask before pulling the trigger.

This is the output of "apt list '~o'"


Code:
libaio1/now 0.3.113-4 amd64 [installed,local]
libapt-pkg6.0/now 2.6.1 amd64 [installed,local]
libassuan0/now 2.5.5-5 amd64 [installed,local]
libcbor0.8/now 0.8.0-2+b1 amd64 [installed,local]
libflac12/now 1.4.2+ds-2 amd64 [installed,local]
libfmt9/now 9.1.0+ds1-2 amd64 [installed,local]
libfuse3-3/now 3.14.0-4 amd64 [installed,local]
libglusterd0/now 10.3-5 amd64 [installed,local]
libicu72/now 72.1-3+deb12u1 amd64 [installed,local]
libldap-2.5-0/now 2.5.13+dfsg-5 amd64 [installed,local]
libpcre3/now 2:8.39-15 amd64 [installed,local]
libperl5.36/now 5.36.0-7+deb12u3 amd64 [installed,local]
libpython3.11-minimal/now 3.11.2-6+deb12u6 amd64 [installed,local]
libpython3.11-stdlib/now 3.11.2-6+deb12u6 amd64 [installed,local]
libsubid4/now 1:4.13+dfsg1-1+deb12u2 amd64 [installed,local]
libthrift-0.17.0/now 0.17.0-2+b2 amd64 [installed,local]
libunistring2/now 1.0-2 amd64 [installed,local]
mime-support/now 3.66 all [installed,local]
perl-modules-5.36/now 5.36.0-7+deb12u3 all [installed,local]
proxmox-kernel-6.8.12-14-pve-signed/now 6.8.12-14 amd64 [installed,local]
proxmox-kernel-6.8.12-15-pve-signed/now 6.8.12-15 amd64 [installed,local]
proxmox-kernel-6.8.12-16-pve-signed/now 6.8.12-16 amd64 [installed,local]
proxmox-kernel-6.8.12-17-pve-signed/now 6.8.12-17 amd64 [installed,local]
proxmox-kernel-6.8.12-18-pve-signed/now 6.8.12-18 amd64 [installed,local]
proxmox-kernel-6.8.4-2-pve-signed/now 6.8.4-2 amd64 [installed,local]
proxmox-kernel-6.8/now 6.8.12-18 all [installed,local]
python3-pysimplesoap/now 1.16.2-5 all [installed,local]
python3.11-minimal/now 3.11.2-6+deb12u6 amd64 [installed,local]
python3.11/now 3.11.2-6+deb12u6 amd64 [installed,local]
spl/now 2.2.9-pve1 all [installed,local]
 
Last edited:
I regularly run apt autoremove --purge without any issues after every (minor) update and it does also remove older kernels.

EDIT: I've done this for years and on many versions, and I seem to have much less problems with my Proxmox setups than most people here.

EDIT2: Sorry, I did not know about '~o' and cannot share experience on that in particular. Please ignore this reply.
 
Last edited:
  • Like
Reactions: UdoB
Yes, but apt autoremove --purge (which is something that I run regularly on my laptopt and debian VMs/containers) is one thing but apt purge "~o" is another.
In this case the former would only remove the old kernels, while the latter would remove the packages I put in the original message.
 
Sorry, I did not know about '~o' but I found this on this forum which indicates to me that it's probably safe, as nothing depends on them since you cannot install those packages anymore:

EDIT: Just ran this on a PVE 9 that was upgraded from PVE 8 and it purged a similar list of packages. It reboots and appears to runs fine.
 
Last edited:
  • Like
Reactions: olivluca
No need to be sorry and thank you. In fact, since I was pretty sure somebody asked a similar question before, I searched the forum first for "apt purge '~o'" (which complained that it wouldn't search for "o" since it's too short) and then for obsolete (I think) and I didn't come up with that message.
 
  • Like
Reactions: leesteken
No problem. Just ran this on several (backed up) Debian containers (including PBS) that were upgraded from Debian 11 and this clean up a lot of old packages (100MB) like gcc-8/9-base. Thank you for informing me about this. I think it should be included in Proxmox upgrade guides.

EDIT: It does not have much effect on Ubuntu or Mint (and LMDE), which probably do this during the (graphical) upgrade process.
 
Last edited:
Doing that on a container is safer: just take a snapshot and rollback in case of problems, but doing it on proxmox itself it's (potentially) more dangerous. Anyway, it works fine.