Apparently not all packages that are upgraded to a newer version are removed from the upgrading system. For example on my system I still have gnome-getting-started-docs-/now 3.36.2+git20201004.1-0ubuntu1 all (and all of its locales) as a "local" package (I assume this is because the repo no longer includes it - why would it...) as well as linux-headers/image/modules/modules-extra versions 5.8.0 and 5.16.19 (these are what I had when upgrading to 21.10 and 22.04).
To check which programes are residuals I used sudo apt list --installed | grep "local]" which does list all packages that don't belong to any archive (so most likely user-installed ones as well, and figuring out what I no longer need is not trivial).
Apparently not all packages that are upgraded to a newer version are removed from the upgrading system. For example on my system I still have
gnome-getting-started-docs-/now 3.36.2+git20201004.1-0ubuntu1 all
(and all of its locales) as a "local" package (I assume this is because the repo no longer includes it - why would it...) as well as linux-headers/image/modules/modules-extra versions 5.8.0 and 5.16.19 (these are what I had when upgrading to 21.10 and 22.04). To check which programes are residuals I usedsudo apt list --installed | grep "local]"
which does list all packages that don't belong to any archive (so most likely user-installed ones as well, and figuring out what I no longer need is not trivial).