debian apt packages hash sum mismatch

旧时模样 提交于 2019-11-28 04:40:10

Try using apt-get:

apt-get clean
rm -rf /var/lib/apt/lists/*
apt-get clean
apt-get update
apt-get upgrade

If deleting /var/lib/apt/lists/* does not work...
(esp. if you're behind a proxy), fix "Hash Sum Mismatch" like this:

Create file /etc/apt/apt.conf.d/99fixbadproxy
with this content

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

See also here

In my case the following solution didn't work for me:

  • /var/lib/apt/lists/*
  • Changing servers to "principal server" (or some other foreing server)

I still was having the same repository giving me the "Hash sum mismatch" error.

I solved trying this solution:

  1. go to "Software & updates"
  2. Uncheck all repositories from the "Ubuntu Software" section
  3. Select the "Autentication" section
  4. Delete all entries
  5. Make a sudo apt update (with no repositories it sould end very soon)
  6. re-open "Software & Updates" -> "Ubuntu Software" and re-check al your needed repositories
  7. try again with sudo apt update

Good luck.

Replace your /etc/apt/sources.list with:

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

Then I'd also run:

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

That should do the trick.

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

I had the similar issue while installing Tizen GBS package.

Only the below solution helped me:

  1. Manually download missed *.deb packages
  2. Copy packages to the /var/cache/apt/archives
  3. Run install command again

In this case apt tool checks the local availability of the package first. If it is present under /var/cache/apt/archives path, then a download step (with hash-sum mismatch error) is skipped.

Example:

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

Upgrade apt with sudo apt-get install apt

sometime reverse proxy(apache,nginx,...) and network will make checksum issue, we can try http proxy of different region to solve the problem:

apt-get update -o Acquire::http::Proxy="$HTTP_PROXY"  -o Debug::Acquire::http=true

EDIT: My ubuntu installation has crashed. I am not sure about the exact reason, but this hack is the prime suspect.

I faced a similar issue

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

Fortunately, the hash mismatch occurred only for one package. Since I was absolutely sure that the package that got downloaded was the intended one, I simply edited out the InRelease file.

The steps I followed: 1. grep for the expected has in /var/lib/apt/lists

sudo grep 46924d3fdb329b18b652bc3410f1f2c92ef1259b9a7d66bb1c5d3804b42a8c1c *
  1. In my case it was

    in.archive.ubuntu.com_ubuntu_dists_artful_main_binary-amd64_Packages

  2. Replaced the hash values of expected file with the hash values of received file.

  3. The upgrade went through.
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!