Sometimes, when I upgrade a system via do-release-upgrade
, the update process fails and the script tells me to finish the process manually via dpkg --configure -a
. This is a not serious problem - after manually solving the dependencies problem and the finishing upgrade process all works well.
But the do-release-upgrade
script has a cleanup process after finishing the upgrade:
Remove obsolete packages?
XXX packages are going to be removed.
Continue [yN] Details [d]y
which removes some obsolete packages from old version of system.
Seems that this process doesn't execute when the automatic upgrade fails and I finish upgrade manually, so obsolete packages from old version remain installed in the system.
How I can run the "Remove obsolete packages" process manually after finishing the upgrade by hand?
dpkg -l|grep "^rc"|awk '{print $2}'
that shows packages to remove. This is strange that apt-get or aptitude dont' want to see it for removing. – Murz Oct 26 '14 at 11:51sudo dpkg -l|grep "^rc"|awk '{print $2}' | xargs sudo apt-get remove -y --purge
. Attention, this command removes packages without confirmation, but is useful for automate quickly cleanup systems. – Murz Oct 26 '14 at 11:59'^rc'
-marked packages weren't even installed, but the upgrade failed right before searching for obsolete packages. So this answer seems incomplete. This won't remove all packages which would be bydo-release-upgrade
, should it succeed. – Ruslan Jul 02 '16 at 13:18