每当我尝试执行时,sudo apt upgrade
我都会得到以下信息:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/8978 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up linux-image-5.4.0-77-generic (5.4.0-77.86) ...
Processing triggers for linux-image-5.4.0-77-generic (5.4.0-77.86) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-77-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 36: /etc/default/grub: Syntax error: Unterminated quoted string
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-5.4.0-77-generic (--configure):
installed linux-image-5.4.0-77-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-5.4.0-77-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
我对输出的解释是,除了两个“未完全安装或删除”的包之外,其他所有包都已安装。
当我尝试执行时,sudo apt autoremove
我得到以下输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-5.4.0-73-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 11.8 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 109583 files and directories currently installed.)
Removing linux-image-5.4.0-73-generic (5.4.0-73.82) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.4.0-73-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 36: /etc/default/grub: Syntax error: Unterminated quoted string
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-5.4.0-73-generic (--remove):
installed linux-image-5.4.0-73-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.4.0-73-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
我也尝试过下列的但这没用。我该如何解决这个问题?
编辑: /etc/默认/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
GRUB_CMDLINE_LINUX="libata.force=noncq
我删除了GRUB_CMDLINE_LINUX="libata.force=noncq
,现在一切又恢复正常了。非常感谢您的帮助!
答案1
我不知道 /etc/default/grub 中的这一行应该做什么,但它需要一个结束引号
GRUB_CMDLINE_LINUX="libata.force=noncq
报告了以下错误
/etc/default/grub:语法错误:未终止的引用字符串
(括号内注释:编辑 /etc/default/grub 后,您需要发出一个sudo update-grub
命令来合并更改。编辑 /etc/default/grub 以进行此更改后,您要么没有发出该命令,要么忽略了由此产生的错误)