The Treminal command "sudo apt-get remove --purge grub" is not removing "linux-image-4.15.0-91-generic"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Based on the message I received back from Ubuntu Help Desk; they suggested using the command:sudo apt-get remove --purge grub. in order to remove linux-image-
This is the full description of what happened when trying to remove:
"linux-
Did not remove "linux-
Best regards,
====
sudo apt-get remove --purge grub
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libc6-i386 linux-modules-
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
grub* linux-image-
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 9,021 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 254282 files and directories currently installed.)
Removing linux-image-
/var/lib/
/etc/kernel/
update-initramfs: Deleting /boot/initrd.
/etc/kernel/
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ...
Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst generated for you? (y/N) /usr/sbin/
run-parts: /etc/kernel/
dpkg: error processing package linux-image-
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-
E: Sub-process /usr/bin/dpkg returned an error code (1)
You should use 'sudo dpkg --purge grub' instead. The problem you're having is that apt is trying to remove other packages which have already been marked for removal, and one of those is the kernel which is where you're running into problems in the first place due to the unconfigured grub on the system.
Using dpkg --purge avoids apt trying to remove packages that you aren't requesting removal of.