![dpkg:处理软件包 linux-image 时出错](https://linux22.com/image/973712/dpkg%EF%BC%9A%E5%A4%84%E7%90%86%E8%BD%AF%E4%BB%B6%E5%8C%85%20linux-image%20%E6%97%B6%E5%87%BA%E9%94%99%20.png)
最近我的 Windows 7 出现故障,于是决定尝试一下 Ubuntu。我注意到 14.04 已经发布,于是决定买一个。到昨天为止,它一直运行良好。不知为何,当我输入“sudo apt-get update”或“sudo apt-get upgrade”时,它无法下载任何内容、更新或升级。
我遇到的错误是:
dpkg: error processing package linux-image-3.13.0-27-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-3.13.0-27-generic
linux-image-3.13.0-27-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
这只是一段代码,但它已被识别为一个错误,但我不知道如何修复它或如何修改它。
我没有遇到功能方面的问题,只是无法更新或下载任何东西很烦人。
答案1
$ cat /etc/default/grub
grub# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
grub.cfg 格式不正确。“grub#”应为“#”。使用 编辑文件sudo gedit /etc/default/grub
并删除前 4 个字符。完成后,运行sudo update-grub
然后sudo apt-get -f install
W: Duplicate sources.list entry http://archive.canonical.com/ubuntu/ trusty/partner amd64 Packages (/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_trusty_partner_binary-amd64_Packages)
W: Duplicate sources.list entry http://archive.canonical.com/ubuntu/ trusty/partner i386 Packages (/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_trusty_partner_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems
grep -rH partner /etc/apt/sources*
显示您已在/etc/apt/sources.list
和中启用了合作伙伴存储库/etc/apt/sources.list.d/canonical_partner.list
。只需启用一次,因此要修复此问题,请执行以下sudo rm -f /etc/apt/sources.list.d/canonical_partner.list
操作sudo apt-get update
。