我在StackOverflow上问过,但被重定向到这里。
恐怕我制造了一种嘘声。
在执行apt-get upgrade
(队列中大约有 160 多个包)时,我不小心注销了,因此中途中止了升级。现在我无法重新开始升级。
apt-get upgrade
说没有要升级的包...
apt-get update
给出错误:
W: Failed to fetch http://security.debian.org/dists/wheezy/updates/main/binary-armel/Packages Hash Sum mismatch
W: Failed to fetch http://security.debian.org/dists/wheezy/updates/contrib/binary-armel/Packages Hash Sum mismatch
W: Failed to fetch http://security.debian.org/dists/wheezy/updates/non-free/binary-armel/Packages Hash Sum mismatch
[several more of these... and ending in: ]
E: Some index files failed to download. They have been ignored, or old ones used instead.
E: Couldn't rebuild package cache
完整的输出在 pastebin 上
我尝试了这些但没有成功:
apt-get -f install
输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
dpkg --configure -a
无输出
rm -vf /var/lib/apt/lists/*; rm -vf /var/lib/apt/lists/partial/*; apt-get update
与上述相同的错误。
dpkg-reconfigure -a
在此之后最终中止:
[ ok ] Stopping acpid (via systemctl): acpid.service.
[ ok ] Starting acpid (via systemctl): acpid.service.
[ ok ] Stopping apache2 (via systemctl): apache2.service.
[ ok ] Starting apache2 (via systemctl): apache2.service.
gpg: key B98321F9: "Squeeze Stable Release Key <[email protected]>" not changed
gpg: key 473041FA: "Debian Archive Automatic Signing Key (6.0/squeeze) <[email protected]>" not changed
gpg: key 65FFB764: "Wheezy Stable Release Key <[email protected]>" not changed
gpg: key 46925553: "Debian Archive Automatic Signing Key (7.0/wheezy) <[email protected]>" not changed
gpg: key 518E17E1: "Jessie Stable Release Key <[email protected]>" not changed
gpg: key 2B90D010: "Debian Archive Automatic Signing Key (8/jessie) <[email protected]>" not changed
gpg: key C857C906: "Debian Security Archive Automatic Signing Key (8/jessie) <[email protected]>" not changed
gpg: Total number processed: 7
gpg: unchanged: 7
[ ok ] Stopping avahi-daemon (via systemctl): avahi-daemon.service.
[ ok ] Reloading dbus configuration (via systemctl): dbus.service.
[ ok ] Starting avahi-daemon (via systemctl): avahi-daemon.service.
update-alternatives: using /usr/share/man/man7/bash-builtins.7.gz to provide /usr/share/man/man7/builtins.7.gz (builtins.7.gz) in auto mode
update-initramfs: deferring update (trigger activated)
[ ok ] Starting loadcpufreq (via systemctl): loadcpufreq.service.
[ ok ] Starting cpufrequtils (via systemctl): cpufrequtils.service.
[ ok ] Stopping cron (via systemctl): cron.service.
[ ok ] Starting cron (via systemctl): cron.service.
[ ok ] Starting dbus (via systemctl): dbus.service.
update-initramfs: deferring update (trigger activated)
update-initramfs: deferring update (trigger activated)
update-initramfs: deferring update (trigger activated)
Regenerating fonts cache... done.
udev active, skipping device node creation.
update-initramfs: deferring update (trigger activated)
dpkg-query: error: --status needs a valid package name but 'gcc-4.7-base' is not: ambiguous package name 'gcc-4.7-base' with more than one installed instance
Use --help for help about querying packages.
/usr/sbin/dpkg-reconfigure: gcc-4.7-base is not installed
我不知道如何找出已安装的内容和未安装的内容。
非常欢迎任何关于如何从中恢复的提示!
这可能应该转移到超级用户或类似用户,但既然你已经被重定向了......
首先,我建议在屏幕会话中运行这些东西。当您注销或连接中断时,这将使更新继续进行:
要分离会话,请按CTRL a然后按d
要重新附加会话类型:
粘贴您列出但尝试但未成功的内容的输出也会很有帮助。
一些建议:
我的建议来自: https ://askubuntu.com/questions/41605/trouble-downloading-packages-list-due-to-a-hash-sum-mismatch-error/
编辑:从您添加的信息来看,您可能需要强制删除gcc-4.7-base,然后重新安装并重复dpkg-reconfigure -a。如果另一个包失败,重复此过程直到成功,然后重新运行 apt-get (dist-)upgrade。