42

在 Debian 命令行中,我在执行aptitude update; aptitude upgrade. 下面是命令行输出。我试过了aptitude clean,但这似乎没有帮助。我也做了一些谷歌搜索,但似乎没有任何帮助。几天来我一直收到不匹配错误。

任何帮助表示赞赏。


Resolving dependencies...
open: 405; closed: 880; defer: 58; conflict: 78.
The following packages will be upgraded:
  apache2.2-bin apt-utils aptdaemon aptdaemon-data avahi-daemon bind9-host dnsutils ekiga gir1.2-cogl-1.0 gir1.2-coglpango-1.0 gstreamer0.10-alsa gstreamer0.10-ffmpeg
  gstreamer0.10-plugins-base gstreamer0.10-x host libapt-inst1.5 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-core7 libavahi-glib1 libavahi-gobject0
  libavahi-ui-gtk3-0 libavahi-ui0 libavutil51 libbind9-80 libcapi20-3 libcogl-common libcogl9 libdbus-glib-1-2 libdns88 libgconf2.0-cil libgssapi-krb5-2 libgssrpc4
  libgstreamer-plugins-base0.10-0 libisc84 libisccc80 libisccfg82 libk5crypto3 libkrb5-3 libkrb5support0 liblwres80 libmp3lame0 libmtp-common libmtp-runtime libmtp9
  libpostproc52 libruby1.8 libswscale2 libsystemd-login0 libtag1-vanilla libtag1c2a libxml2 libxml2-utils linux-headers-3.2.0-4-686-pae linux-headers-3.2.0-4-common
  linux-image-3.2.0-4-686-pae linux-libc-dev linux-source-3.2 python-aptdaemon python-aptdaemon-gtk python-aptdaemon.gtk3widgets python-aptdaemon.gtkwidgets
  python-libxml2 python-numpy ruby1.8 telepathy-gabble unattended-upgrades xserver-xorg-video-ati xserver-xorg-video-radeon
The following packages are RECOMMENDED but will NOT be installed:
  krb5-locales
70 packages upgraded, 0 newly installed, 0 to remove and 168 not upgraded.
Need to get 4322 kB/136 MB of archives. After unpacking 7982 kB will be used.
Do you want to continue? [Y/n/?]
Get: 1 http://www.deb-multimedia.org/ testing/main libavutil51 i386 8:1.0.5-dmo1 [111 kB]
Get: 2 http://www.deb-multimedia.org/ testing/main libmp3lame0 i386 1:3.99.5-dmo2 [338 kB]
Get: 3 http://www.deb-multimedia.org/ testing/main libpostproc52 i386 8:1.0.5-dmo1 [79.6 kB]
Get: 4 http://www.deb-multimedia.org/ testing/main libswscale2 i386 8:1.0.5-dmo1 [126 kB]
Get: 5 http://www.deb-multimedia.org/ testing/main libtag1-vanilla i386 1.8-dmo1 [257 kB]
Get: 6 http://www.deb-multimedia.org/ testing/main libtag1c2a i386 1.8-dmo1 [9396 B]
Get: 7 http://www.deb-multimedia.org/ testing/main gstreamer0.10-ffmpeg i386 1:0.10.13-dmo1 [3402 kB]
Fetched 4322 kB in 35s (121 kB/s)                                                                                                                                                
E: Failed to fetch http://www.deb-multimedia.org/pool/main/f/ffmpeg-dmo/libavutil51_1.0.5-dmo1_i386.deb: Hash Sum mismatch
E: Unable to correct for unavailable packages
4

11 回答 11

70

尝试使用apt-get

apt-get clean
rm -rf /var/lib/apt/lists/*
apt-get clean
apt-get update
apt-get upgrade
于 2013-03-19T19:29:29.037 回答
31

如果删除/var/lib/apt/lists/*不起作用...
(尤其是如果您在代理后面),请像这样修复“哈希和不匹配”

使用此内容创建文件 /etc/apt/apt.conf.d/99fixbadproxy

Acquire::http::Pipeline-Depth 0;
Acquire::http::No-Cache true;
Acquire::BrokenProxy    true;

另请参阅此处

于 2015-12-14T16:45:14.570 回答
22

我在 Windows 上使用 Virtualbox 时遇到了这个问题,Ubuntu 作为我的 GuestOS。由于 Hyper-V 在 Windows 上运行,我得到了哈希和不匹配(以及其他奇怪的错误)。此链接详细说明了如何禁用 Hyper-V,摘录如下:

打开 Powershell - 以管理员身份运行并使用以下命令:

bcdedit /set hypervisorlaunchtype off

随后重新启动。

于 2020-06-09T04:58:02.650 回答
5

我在安装 Tizen GBS 包时遇到了类似的问题。

只有以下解决方案对我有帮助:

  1. 手动下载错过的 *.deb 包
  2. 将包复制到 /var/cache/apt/archives
  3. 再次运行安装命令

在这种情况下,apt 工具首先检查包的本地可用性。如果它存在于 /var/cache/apt/archives 路径下,则跳过下载步骤(带有哈希和不匹配错误)。

例子:

wget http://download.tizen.org/tools/latest-release/Ubuntu_16.04/amd64/librpm-tizen_4.11.0.1.tizen20140530-tizen20140723_amd64.deb

sudo cp librpm-tizen_4.11.0.1.tizen20140530-tizen20140723_amd64.deb /var/cache/apt/archives
于 2018-07-31T12:19:48.850 回答
2

编辑:我的 ubuntu 安装崩溃了。我不确定确切的原因,但这个黑客是主要嫌疑人。

我遇到了类似的问题

Get:1 http://in.archive.ubuntu.com/ubuntu artful/main amd64 openjdk-8-jre-headless amd64 8u144-b01-2 [27.3 MB]                                                                                                                                                                 
Err http://in.archive.ubuntu.com/ubuntu artful/main amd64 openjdk-8-jre-headless amd64 8u144-b01-2                                                                                                                                                                             
  Hash Sum mismatch
Hashes of expected file:
 - SHA256:46924d3fdb329b18b652bc3410f1f2c92ef1259b9a7d66bb1c5d3804b42a8c1c
 - SHA1:0097b24ef75249d381c7c3f3fb6b36593720c15e [weak]
 - MD5Sum:1ff35c4d8a2bed71dceba105801cf567 [weak]
 - Filesize:27256930 [weak]
Hashes of received file:
 - SHA256:ea6892eb6ce7cdc1674a46719302cdbf1b9d485e36bccd27247591527423bb6d
 - SHA1:8c19fbdc9f534d8d3c304374bf0c8e7b05cb620b [weak]
 - MD5Sum:1ff35c4d8a2bed71dceba105801cf567 [weak]
 - Filesize:27256930 [weak]
Last modification reported: Sat, 30 Sep 2017 20:08:32 +0000

幸运的是,哈希不匹配只发生在一个包中。因为我绝对确定下载的包是预期的,所以我简单地编辑了 InRelease 文件。

我遵循的步骤:1.grep对于预期的有/var/lib/apt/lists

sudo grep 46924d3fdb329b18b652bc3410f1f2c92ef1259b9a7d66bb1c5d3804b42a8c1c *
  1. 就我而言,它是

    in.archive.ubuntu.com_ubuntu_dists_artful_main_binary-amd64_Packages

  2. 将预期文件的哈希值替换为接收文件的哈希值。

  3. 升级通过了。
于 2017-10-23T13:55:35.887 回答
1

将您的替换/etc/apt/sources.list为:

deb http://http.debian.net/debian/ jessie main
deb http://http.debian.net/debian/ jessie-backports main
deb http://security.debian.org/ jessie/updates main

然后我也会跑:

sudo apt-key update -y
sudo apt-get update -y
sudo apt-get upgrade -y

这应该够了吧。

@source:https ://www.lowendtalk.com/discussion/62567/apt-get-hash-sum-mismatch-debian-jessie

于 2017-08-30T13:44:19.867 回答
0

升级apt_sudo apt-get install apt

于 2015-04-23T02:18:48.450 回答
0

在我的情况下,它试图从 nodesource 安装 Nodejs,但最终总是出现问题:“哈希和不匹配”。上述解决方案均无效。

我不明白为什么,因为我按照信中的说明进行操作:

# 使用 Debian,作为 root
curl -sL nodesource-url | 重击 -
apt-get install -y nodejs

事实证明,当我的主要 debian sources.list 使用 http 时,Nodejs 的存储库使用了 https。

  • 猫 /etc/apt/sources.list.d/nodesource.list
德布 https://...
deb-src https://...

将 URL 更改为http并运行apt-get update解决了这个问题。

于 2020-07-25T10:01:06.750 回答
0

对我来说,rm -rf /var/lib/apt/lists/* && apt-get update没有用。
然而,rm -rf /var/lib/apt/lists/* && apt update确实奏效了。

于 2020-10-20T06:59:47.020 回答
0

在我的情况下,以下解决方案对我不起作用:

  • /var/lib/apt/lists/*
  • 将服务器更改为“主要服务器”(或其他一些外部服务器)

我仍然有相同的存储库给我“哈希和不匹配”错误。

我解决了尝试这个解决方案:

  1. 转到“软件和更新”
  2. 从“Ubuntu软件”部分取消选中所有存储库
  3. 选择“身份验证”部分
  4. 删除所有条目
  5. 制作一个sudo apt update(没有存储库,它很快就会结束)
  6. 重新打开“软件和更新”->“Ubuntu 软件”并重新检查所有您需要的存储库
  7. 再试一次sudo apt update

祝你好运。

于 2016-09-18T14:59:09.423 回答
0

有时反向代理(apache,nginx,...)和网络会产生校验和问题,我们可以尝试不同区域的http代理来解决问题:

apt-get update -o Acquire::http::Proxy="$HTTP_PROXY"  -o Debug::Acquire::http=true
于 2016-11-04T08:36:39.787 回答