I tested this when upgrading from xenial to bionic and this worked well.
root@clean-xenial-amd64:/tmp/ubuntu-release-upgrader-qc5mefel# head -n10 /var/log/dist-upgrade/main.log 2019-05-09 13:31:56,719 INFO Using config files '['./DistUpgrade.cfg.xenial']' 2019-05-09 13:31:56,719 INFO uname information: 'Linux clean-xenial-amd64 4.15.0-47-generic #50~16.04.1-Ubuntu SMP Fri Mar 15 16:06:21 UTC 2019 x86_64' 2019-05-09 13:31:56,995 INFO apt version: '1.2.31' 2019-05-09 13:31:56,996 INFO python version: '3.5.2 (default, Nov 12 2018, 13:43:14) [GCC 5.4.0 20160609]' 2019-05-09 13:31:56,998 INFO release-upgrader version '18.04.32' started 2019-05-09 13:31:57,001 INFO locale: 'en_US' 'UTF-8' 2019-05-09 13:31:57,100 DEBUG Using 'DistUpgradeViewText' view 2019-05-09 13:31:57,136 DEBUG enable dpkg --force-overwrite 2019-05-09 13:31:57,154 DEBUG creating statefile: '/var/log/dist-upgrade/apt-clone_system_state.tar.gz' root@clean-xenial-amd64:/tmp/ubuntu-release-upgrader-qc5mefel# grep -i obsoletekernel /var/log/dist-upgrade/main.log 2019-05-09 14:09:58,075 DEBUG identifyObsoleteKernels() 2019-05-09 14:10:03,979 DEBUG identifyObsoleteKernels found '{'linux-image-4.4.0-98-generic', 'linux-signed-image-4.4.0-98-generic'}'
I tested this when upgrading from xenial to bionic and this worked well.
root@clean- xenial- amd64:/ tmp/ubuntu- release- upgrader- qc5mefel# head -n10 /var/log/ dist-upgrade/ main.log e.cfg.xenial' ]' wText' view dist-upgrade/ apt-clone_ system_ state.tar. gz' xenial- amd64:/ tmp/ubuntu- release- upgrader- qc5mefel# grep -i obsoletekernel /var/log/ dist-upgrade/ main.log eKernels( ) eKernels found '{'linux- image-4. 4.0-98- generic' , 'linux- signed- image-4. 4.0-98- generic' }'
2019-05-09 13:31:56,719 INFO Using config files '['./DistUpgrad
2019-05-09 13:31:56,719 INFO uname information: 'Linux clean-xenial-amd64 4.15.0-47-generic #50~16.04.1-Ubuntu SMP Fri Mar 15 16:06:21 UTC 2019 x86_64'
2019-05-09 13:31:56,995 INFO apt version: '1.2.31'
2019-05-09 13:31:56,996 INFO python version: '3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609]'
2019-05-09 13:31:56,998 INFO release-upgrader version '18.04.32' started
2019-05-09 13:31:57,001 INFO locale: 'en_US' 'UTF-8'
2019-05-09 13:31:57,100 DEBUG Using 'DistUpgradeVie
2019-05-09 13:31:57,136 DEBUG enable dpkg --force-overwrite
2019-05-09 13:31:57,154 DEBUG creating statefile: '/var/log/
root@clean-
2019-05-09 14:09:58,075 DEBUG identifyObsolet
2019-05-09 14:10:03,979 DEBUG identifyObsolet