apt-get - 无法安装或删除任何软件包 - 错误处理 linux-image-3.13.0-66-generic:删除后脚本返回状态 1

apt-get - 无法安装或删除任何软件包 - 错误处理 linux-image-3.13.0-66-generic:删除后脚本返回状态 1

任何试图安装或删除软件包的尝试都会导致apt-get错误,输出如下。现在的错误与我最初遇到的错误不同 - 与这个问题,但应用建议修复没有帮助,现在我遇到以下错误:

$ 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)

现在如何强制删除此包并从头开始重新安装它,或者以任何不同的方式修复此错误?

答案1

您的语法错误为

/etc/default/grub

/usr/sbin/grub-mkconfig: 35: /etc/default/grub: 语法错误:反引号替换中的 EOF

第 35 行具有误导性,因为问题出在之前的几行中。

真正的问题是有开头`却没有结尾`

没有的话/etc/default/grub很难说哪条线路受到了影响。

你可以找到那行字,也可以将你的内容添加/etc/default/grub到你的问题中。然后我就可以给你一个完美的答案。;)

相关内容