The Treminal command "sudo apt-get remove --purge grub" is not removing "linux-image-4.15.0-91-generic"

Bug #1879383 reported by Jamal Sarraf
6
This bug affects 1 person
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-4.15.0-91-generic".

This is the full description of what happened when trying to remove:
"linux-image-4.15.0-91-generic" & "libc6-i386"

Did not remove "linux-image-4.15.0-91-generic" and there still having errors (Could not find /boot/grub/menu.lst file).

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-4.15.0-91-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  grub* linux-image-4.15.0-91-generic
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-4.15.0-91-generic (4.15.0-91.92~16.04.1) ...
/var/lib/dpkg/info/linux-image-4.15.0-91-generic.postrm ... removing pending trigger
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-91-generic
/etc/kernel/postrm.d/zz-update-grub:
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/update-grub: line 1094: read: read error: 0: Bad file descriptor
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-4.15.0-91-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-4.15.0-91-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Steve Langasek (vorlon) wrote :

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.

Changed in grub (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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