20

This is pertaining Ubuntu 18.04 LTS. I tried to save space by removing unneeded Linux kernel, but looks like it will still install other kernel image that is "Unsigned". Why is this?

Here is the log:

root@ubuntu18:~# apt-get remove linux-image-4.18.0-15-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  linux-image-unsigned-4.18.0-15-generic
Suggested packages:
  fdutils linux-hwe-doc-4.18.0 | linux-hwe-source-4.18.0 linux-hwe-tools
The following packages will be REMOVED:
  linux-image-4.18.0-15-generic linux-modules-extra-4.18.0-15-generic
The following NEW packages will be installed:
  linux-image-unsigned-4.18.0-15-generic
0 upgraded, 1 newly installed, 2 to remove and 8 not upgraded.
Need to get 8,219 kB of archives.
After this operation, 168 MB disk space will be freed.
Do you want to continue? [Y/n]

The original Linux kernel version that ships with the distro appears to be version 4.18. The new version that was just installed was 5.0. So I wonder if there is a reason to "preserve" 4.18.

Wirawan

2
  • 1
    I have the same problem on 18.04.3 LTS. My current kernel is 4.15.0-72, but I can't remove 4.15.0-62 nor -70 without it trying to install the unsigned version instead. I have rebooted, but I can still remove zero of the kernels, and therefore can't run apt-get upgrade (lack of space).
    – exscape
    Dec 8, 2019 at 16:02
  • 1
    How did you install a new 5.0 kernel? What is the current kernel the system is running?
    – Pilot6
    Dec 8, 2019 at 16:47

4 Answers 4

11

The dependency is causing it; look for the 'linux-modules' ("linux-modules-") package and purge that instead.

sudo apt purge -f linux-modules-4.18.0-15-generic
1
  • 4
    This is actually the best answer in the list as it mentions and tackles the root cause of the other kernel being installed. Oct 31, 2022 at 9:51
9

I solved this by just exiting apt and adding the unsigned image to the end of the apt-get remove command.

1
  • 2
    This did not work for me. The unsigned kernel was brought back as the normal one after this procedure. And I can't remove it - remove, purge just changes its state but not remove.
    – t7e
    Jul 15, 2022 at 7:18
7

It seemed not obvious, but quite a simple solution - just remove them both in one command:

sudo apt-get remove --purge linux-image-4.18.0-15-generic linux-image-unsigned-4.18.0-15-generic

or with bash expression:

apt-get remove --purge linux-image{,-unsigned}-4.18.0-15-generic
1
  • 1
    Thank you, your solution was the one that helped me. Specifically the remove --purge part, and also adding the signed and the unsigned version to the command. Thanks! Jul 17, 2022 at 22:46
4

I solved (worked around?) this with the linux-purge utility, created for this very purpose.

The command line I used was linux-purge -bc -k 1:

-b to check /boot for kernels not in APT
-c to interactively choose which kernels to remove
-k 1 to keep one earlier version

I then selected both kernels in the text UI (which probably overrode the -k option). I was left with the current/running kernel and the others removed, so it worked perfectly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .