apt autoremove not removing old kernels
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
I noticed that apt autoremove stopped removing old kernels recently. Currently I have 6 installed and apt autoremove does not try to remove old ones:
$ sudo apt 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.
In /etc/apt/
# list of different kernel versions:
4.15.0-
4.15.0-
4.15.0-
4.15.0-
4.13.0-
4.13.0-
# Installing kernel: 4.13.0-
# Running kernel: 4.15.0-
# Last kernel: 4.15.0-
# Previous kernel: 4.15.0-
# Kernel versions list to keep:
4.13.0-
4.15.0-
4.15.0-
# Kernel packages (version part) to protect:
4\.13\.0-45-generic
4\.15\.0-23-generic
4\.15\.0-24-generic
It was working fine previously and I didn't change anything that could break this functionality.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: apt 1.2.26
ProcVersionSign
Uname: Linux 4.15.0-24-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Jul 2 14:12:03 2018
InstallationDate: Installed on 2018-01-19 (164 days ago)
InstallationMedia: Ubuntu 16.04.3 LTS "Xenial Xerus" - Release amd64 (20170801)
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)
I was looking into the same thing
It seems like this is intentional
I'm on this version
lsb_release -a 1.0ubuntu2- noarch: printing- 11.1.0ubuntu2- noarch: security- 11.1.0ubuntu2- noarch
LSB Version: core-11.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
It appears apt is configured to never autoremove kernels
/etc/apt/ apt.conf. d/01autoremove
NeverAutoRemove
"^firmware- linux.* ";
"^linux- firmware$ ";
"^linux- image-[ a-z0-9] *$";
"^linux- image-[ a-z0-9] *-[a-z0- 9]*$";
{
};