Do-release-upgrade process interrrupted, and no obsolete packages removed

Hello, everyone

Yesterday I tried to upgrade my Ubuntu server from 18.04 TLS to 20.04 TLS. I did this.

After that the system got started to download packages, but it was too slow so that I pressed ctrl + C to cancel the upgrade process.

Later, when I tried to run do-release-upgrade again, I got this message.
Please install all available updates for your release before upgrading

So after some trials, I managed to continue the downloading process via
apt dist-upgrade

And the system got back to the downloading process and until the upgrade finished. However, I noticed that if the do-release-upgrade were not interrupted, users should have received a message,

Remove obsolete packages?  
XXX packages are going to be removed.  
Continue [yN]  Details [d]y

However, by apt dist-upgrade I did not received this message. So I think I should remove these obsolete package by another method. Would you know how to?


I cannot reply. So I have to edit the first post.

I did this

sudo -i

apt-get update

apt-get autoremove

apt-get clean

UNUSCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')

apt-get remove --purge $UNUSCONF

NEWKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')



UNUSKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $ADDKERNEL |grep -vE $METAKERNEL|grep -v $NEWKERNEL)

apt-get remove --purge $UNUSKERNELS


Try sudo apt autoremove.