Saturday, November 10, 2018

kernel - apt-get - cannot install or remove any pacakges - error processing linux-image-3.13.0-66-generic: post-removal script returned status 1


Any attempt to install or remove packages with apt-get ends in error with the output as below. The error is now different from the one I had initially - the same one as in this question, but applying the proposed fix didn't help and now what I have is the error below:


$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-3.13.0-66-generic linux-image-extra-3.13.0-66-generic
0 upgraded, 0 newly installed, 2 to remove and 13 not upgraded.
2 not fully installed or removed.
After this operation, 194 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 653298 files and directories currently installed.)
Removing linux-image-extra-3.13.0-66-generic (3.13.0-66.108) ...
depmod: FATAL: could not load /boot/System.map-3.13.0-66-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-66-generic /boot/vmlinuz-3.13.0-66-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.13.0-66-generic /boot/vmlinuz-3.13.0-66-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-66-generic /boot/vmlinuz-3.13.0-66-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-66-generic
grep: /boot/config-3.13.0-66-generic: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_VxrrWc/lib/modules/3.13.0-66-generic/modules.order: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_VxrrWc/lib/modules/3.13.0-66-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.13.0-66-generic /boot/vmlinuz-3.13.0-66-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.13.0-66-generic /boot/vmlinuz-3.13.0-66-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.13.0-66-generic /boot/vmlinuz-3.13.0-66-generic
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: Syntax error: EOF in backquote substitution
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-extra-3.13.0-66-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.13.0-66-generic (3.13.0-66.108) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-66-generic /boot/vmlinuz-3.13.0-66-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-66-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-66-generic /boot/vmlinuz-3.13.0-66-generic
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: Syntax error: EOF in backquote substitution
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.13.0-66-generic.postrm line 328.
dpkg: error processing package linux-image-3.13.0-66-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-3.13.0-66-generic
linux-image-3.13.0-66-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

How can one remove forcibly this package now and reinstall it from scratch, or fix this error anyhow differently?



You have a syntax error in


/etc/default/grub


/usr/sbin/grub-mkconfig: 35: /etc/default/grub: Syntax error: EOF in backquote substitution



Line 35 is misleading because the problem is in some lines before.


The real problem is that you have an opening ` without a closing `.


Without /etc/default/grub it is hard to say which line is affected.


You can either find the line or you could add your /etc/default/grub to your question. Then I can give you a perfect answer. ;)


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...