apt-get升级得到中止如何恢复? (哈希总和不匹配)

我问StackOverflow,但redirect在这里。

恐怕我做了一个booboo。

在执行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 

我不知道如何找出什么是安装的,什么不是。

任何提示如何从这个恢复是非常欢迎的!

这可能应该转移到超级用户或这样的,但因为你已经被重新定向…

首先,我会build议在屏幕会话中运行这样的事情。 当您注销或连接终止时,这将使更新继续:

 screen -S upd 

要删除会话,请按CTRL a,然后按d

要重新附加会话types:

 screen -r upd 

粘贴你所列出的东西的输出也是有帮助的,

一些build议:

  • 你尝试切换存储库吗?
  • recursion地删除 / var / lib / apt / lists / *
  • 你是否mkdir / var / lib / apt / lists / partial

我从我的build议: 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-)升级。