1

The question at hand is:

How to completely remove (purge) unused (removed via GUI) kernel packages in Linux Mint 18.x after man removes these kernels via Mint Update Manager -> Linux Kernels window?

As you can see below, there is only one kernel installed, I have removed all others:

Mint Update Manager -> Linux Kernels

Since they were removed, I presumed they were purged completely, but I was wrong. Once I did:

dpkg --list | grep "linux-image"

There was more like 30 packages with rc prefix.

1

The rc prefix - these two letters signify the status of the packages as follows:

  1. r : the package was marked for removal
  2. c : the configuration files are present in the system

First we need to get the list of the packages, that were removed, while leaving the configuration behind:

dpkg --list | grep "^rc  linux-image" | cut --delimiter " " --fields 3

Once we have the list, we can manually purge these kernel packages, e.g.:

sudo apt-get purge linux-image-4.10.0-20-generic linux-image-extra-4.10.0-20-generic

Notice, we are actually always removing two packages:

  1. linux-image-*
  2. linux-image-extra-*

One problem you will possibly encounter is a warning that the kernel library directory wasn't removed because it's not empty. I decided that I will leave it as it is, because I would have to google another hour for an explanation whether or not I can just:

sudo rm -rf /lib/modules/4.10.0-20-generic/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.