我遇到这个问题已经有大约一周了,我无法安装、自动删除或更新,否则就会出现问题,因为我尝试更新内核但问题仍然没有解决,所以我认为问题出在内核上。
E: 子进程 /usr/bin/dpkg 返回错误代码 (1)
自动删除的示例:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-5.8.0-53-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 9822 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 372505 files and directories currently installed.)
Removing linux-image-5.8.0-53-generic (5.8.0-53.60~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.8.0-53-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 34: /etc/default/grub: Syntax error: EOF in backquote s
ubstitution
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-5.8.0-53-generic (--remove):
installed linux-image-5.8.0-53-generic package post-removal script subprocess r
eturned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.8.0-53-generic
Processing was halted because there were too many errors.
**E: Sub-process /usr/bin/dpkg returned an error code (1)**
答案1
相关错误信息是/usr/sbin/grub-mkconfig: 34: /etc/default/grub: Syntax error: EOF in backquote
。
查找坏线
grep -n '`' /etc/default/grub
修复它。