System Info: Dell 4600, LXLE 18.04.3 (i386) Symptoms: “apt autoremove --purge” tries to remove all kernels, warning before removal of the running kernel. Advertised behavior is to remove all kernels except running kernel and next most recent kernel, so 2 kernels should remain after doing autoremove. Background: Executable file “/etc/kernel/postinst.d/apt-auto-removal" searches the apt configuration files in directory /etc/apt/apt.conf.d for a section labeled ‘APT::VersionedKernelPackages’ and uses this as input to generate the “/etc/apt/apt.conf.d/01autoremove-kernels” configuration file. File ‘01autoremove-kernels’ contains the section ‘’APT::NeverAutoRemove’ which is read by the ‘apt autoremove’ command to determine which kernels to keep. Source of Problem: LXLE 18.04.3 appears to be missing an apt configuration file containing the section labeled ‘APT::VersionedKernelPackages’, resulting in “/etc/kernel/postinst.d/apt-auto-removal" creating an “/etc/apt/apt.conf.d/01autoremove-kernels” config file that contains an empty section for ‘’APT::NeverAutoRemove’, even though all of the debug info is there. Thus “apt autoremove” thinks there are no kernels to be retained. Possible fix: Lubuntu 18.04.3, as installed, contains apt configuration file “/etc/apt/apt.conf.d/01autoremove” which contains the ‘APT::VersionedKernelPackages’ section that is needed by “/etc/kernel/postinst.d/apt-auto-removal”.
The above represents my best understanding of the situation, but should not be taken as gospel. Hope I have not turned everyone’s mind to mush with this rendition........