Removing linux-image-4.15.0-112-generic fails - more errors follow
by jan128 from LinuxQuestions.org on (#5BKYX)
I am trying to install bluetooth library on Ubuntu 16.
The install saiz it will remove "linux-image-4.15.0-112-generic" but it fails to do so.
Also the primary task to install the library does not complete.
The process also finds problem with grub , gives option to correct it but never stops to take the option.
Running "update " and "upgrade" gives similar results - error code.
I prefer NOT to edit "grub" manually.
Any SAFE suggestions how to recover from these errors would be greatly appreciated.
Thanks
'
Code:
f@f-SATA:~$ sudo apt-get install libbluetooth-dev
[sudo] password for f:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
grub-efi-amd64-bin shim
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
linux-image-4.15.0-112-generic
The following NEW packages will be installed:
libbluetooth-dev
0 upgraded, 1 newly installed, 1 to remove and 66 not upgraded.
2 not fully installed or removed.
Need to get 0 B/145 kB of archives.
After this operation, 7,652 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 245609 files and directories currently installed.)
Removing linux-image-4.15.0-112-generic (4.15.0-112.113~16.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-112-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-112-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-4.15.0-112-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
f@f-SATA:~$


The install saiz it will remove "linux-image-4.15.0-112-generic" but it fails to do so.
Also the primary task to install the library does not complete.
The process also finds problem with grub , gives option to correct it but never stops to take the option.
Running "update " and "upgrade" gives similar results - error code.
I prefer NOT to edit "grub" manually.
Any SAFE suggestions how to recover from these errors would be greatly appreciated.
Thanks
'
Code:
f@f-SATA:~$ sudo apt-get install libbluetooth-dev
[sudo] password for f:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
grub-efi-amd64-bin shim
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
linux-image-4.15.0-112-generic
The following NEW packages will be installed:
libbluetooth-dev
0 upgraded, 1 newly installed, 1 to remove and 66 not upgraded.
2 not fully installed or removed.
Need to get 0 B/145 kB of archives.
After this operation, 7,652 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 245609 files and directories currently installed.)
Removing linux-image-4.15.0-112-generic (4.15.0-112.113~16.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-112-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-112-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-4.15.0-112-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
f@f-SATA:~$