I'm managing a couple of servers for core services (NTP, DNS, etc) and it just occured to me that one of the servers seems to keep the 3 latest kernels, instead of 2 on the others :
nul@quark:~$ sudo apt-get autoremove --purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
nul@quark:~$ dpkg -l |grep linux-image
ii linux-image-3.13.0-51-generic 3.13.0-51.84 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii linux-image-3.13.0-52-generic 3.13.0-52.85 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii linux-image-3.16.0-37-generic 3.16.0-37.49~14.04.1 amd64 Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii linux-image-extra-3.13.0-51-generic 3.13.0-51.84 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii linux-image-extra-3.13.0-52-generic 3.13.0-52.85 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii linux-image-extra-3.16.0-37-generic 3.16.0-37.49~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii linux-image-generic 3.13.0.52.59 amd64 Generic Linux kernel image
ii linux-image-generic-lts-utopic 3.16.0.37.29 amd64 Generic Linux kernel image
...
nul@dwarf:~$ sudo apt-get autoremove --purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
nul@dwarf:~$ dpkg -l |grep linux-image
ii linux-image-3.13.0-52-generic 3.13.0-52.85 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii linux-image-3.16.0-37-generic 3.16.0-37.49~14.04.1 amd64 Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii linux-image-extra-3.13.0-52-generic 3.13.0-52.85 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP
ii linux-image-extra-3.16.0-37-generic 3.16.0-37.49~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii linux-image-generic 3.13.0.52.59 amd64 Generic Linux kernel image
ii linux-image-generic-lts-utopic 3.16.0.37.29 amd64 Generic Linux kernel image
All servers are maintained identically, don't know what I could have done, must be a parameter somewhere but can't find it!
Please feed my curiosity! Thank you
apt-auto-remove
script to generate a new/etc/apt/apt.conf.d/01autoremove-kernels
– Terrance May 06 '15 at 20:42sudo apt-mark auto ^linux-image-
followed bysudo apt-get autoremove --purge
but to no avail; however, a littledist-upgrade
modified 2 kernels (3.13.0-52 and 3.16.0.37) and the followingautoremove
got rid of 3.13.0-51... – ionreflex May 07 '15 at 14:37dist-upgrade
you ran kicked off the/etc/kernel/postinst.d/apt-auto-removal
which then modified the/etc/apt/apt.conf.d/01autoremove-kernels
then telling it which ones to keep. – Terrance May 07 '15 at 15:28dist-upgrade
before, but maybe the fact that the kernels got upgraded this morning did the trick... anyway, cheers, and thank you for your answer, I've learned a lot through it! – ionreflex May 07 '15 at 15:38/etc/apt/apt.conf.d/01autoremove
and it has aNeverAutoRemove
block in it which seems to include anything that looks likelinux-image
,linux-firmware
orfirmware-linux
, so I'm assuming this is done differently now? Is it handled by the packages themselves? – pzkpfw Oct 03 '22 at 10:37