Old kernel files aren't completely autoremoved

Bug #1907887 reported by g
56
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Ubuntu
Confirmed
Undecided
Unassigned

Bug Description

Hello everyone,

I'm a KDE neon user and noticed that on my installation, the required hard disc space keeps increases after each kernel update. The reason is that after installing a new kernel, old one's files are kept in '/usr/lib/modules/X.X.X-XX-generic/' and '/usr/src/linux-headers-X.X.X-XX/'. The old kernels can be manually removed using the package management which frees the space, however a simple autoremove does not delete the files.

In the respective topic I created at the KDE neon forum (https://forum.kde.org/viewtopic.php?f=309&t=169067), this bug is caused by ubuntu's kernel management that incorrectly marks the old kernel packages as manually installed while upgrading them. Therefore I quickly wanted to report this bug (hoping that it's not a duplicate, at least I did not find one).

Tags: bot-comment
Revision history for this message
g (gibtnix) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1907887/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu:
status: New → Confirmed
g (gibtnix)
description: updated
g (gibtnix)
description: updated
Revision history for this message
Mahendra Tallur (mahen) wrote :

Hi ! An important side effect is that, after several months/years, updates take an increasing amount time due to the presence of many unused kernels.

Now that some distros (incl. Neon) use offline updates (applied after rebooting), it gives the feeling the update stopped / crashed.

Revision history for this message
Mahendra Tallur (mahen) wrote :

As KDE Neon uses Ubuntu LTS, does it also affect regular Ubuntu installations ?
I would be surprised as the bug is extremely obvious after a few months.
What can we do to help fix it ?

Meanwhile, I use this command to mark old kernels as manually installed so that they get remove with "apt-get autoremove" :

sudo apt-mark auto $(apt-mark showmanual | grep -E "^linux-([[:alpha:]]+-)+[[:digit:].]+-[^-]+(|-.+)$")

Revision history for this message
sultan (sultanqasim) wrote :

I'm facing the same issue on the latest KDE Neon. I had to use the command Mahendra mentioned to allow old kernels to be autoremoved and free up around 15 GB of disk space.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.