0

Please see the error that I get every time when I try to apt update below. I use a Raspberry Pi 3 Model B.

I did a lot of research and tried a lot of things to solve that issue:

-Changed the /etc/apt/sources.list and tried at least 8 different mirrors
-Used another SD card and tried another OS (Ubuntu Server), which resulted in the same hash sum mismatch error.
-Removed the files in /var/lib/apt/lists

Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Get:2 http://mirrors.dotsrc.org/raspbian/raspbian buster InRelease [15.0 kB]
Get:3 http://mirrors.dotsrc.org/raspbian/raspbian buster/main armhf Packages [13.0 MB]
Err:3 http://mirrors.dotsrc.org/raspbian/raspbian buster/main armhf Packages
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:13004660 [weak]
   - SHA256:f32bfac3781e4ba0fb0d24b506c2fb3e4f8c3e6aa07ac12a44da808e5e6f67cb
   - SHA1:9ff62b5e584f418a138a394fc14ee9acf6f16618 [weak]
   - MD5Sum:0d073ad80299789c43c61ebe1ac18000 [weak]
  Hashes of received file:
   - SHA256:d6a8c7bfca7d92bc9d05d0d4681395a55a34f21e0ccb256f7ea83ad92ca45917
   - SHA1:7e063285421e0dac16a333e66322b41ea0eb9303 [weak]
   - MD5Sum:11f8227ec8fe20bdcf628ad34f96bc59 [weak]
   - Filesize:13004660 [weak]
  Last modification reported: Thu, 01 Oct 2020 23:02:49 +0000
  Release file created at: Thu, 01 Oct 2020 23:09:32 +0000
Get:4 http://mirrors.dotsrc.org/raspbian/raspbian buster/contrib armhf Packages [58.7 kB]
Get:5 http://mirrors.dotsrc.org/raspbian/raspbian buster/non-free armhf Packages [104 kB]
Get:6 http://mirrors.dotsrc.org/raspbian/raspbian buster/rpi armhf Packages [1,360 B]
Fetched 13.2 MB in 4s (3,491 kB/s)
Reading package lists... Done
E: Failed to fetch http://mirrors.dotsrc.org/raspbian/raspbian/dists/buster/main/binary-armhf/Packages.xz  Hash Sum mismatch
   Hashes of expected file:
    - Filesize:13004660 [weak]
    - SHA256:f32bfac3781e4ba0fb0d24b506c2fb3e4f8c3e6aa07ac12a44da808e5e6f67cb
    - SHA1:9ff62b5e584f418a138a394fc14ee9acf6f16618 [weak]
    - MD5Sum:0d073ad80299789c43c61ebe1ac18000 [weak]
   Hashes of received file:
    - SHA256:d6a8c7bfca7d92bc9d05d0d4681395a55a34f21e0ccb256f7ea83ad92ca45917
    - SHA1:7e063285421e0dac16a333e66322b41ea0eb9303 [weak]
    - MD5Sum:11f8227ec8fe20bdcf628ad34f96bc59 [weak]
    - Filesize:13004660 [weak]
   Last modification reported: Thu, 01 Oct 2020 23:02:49 +0000
   Release file created at: Thu, 01 Oct 2020 23:09:32 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.
  • what happens if you set it to the default value of http://raspbian.raspberrypi.org/raspbian/ – Jaromanda X Oct 3 '20 at 2:38
  • It is the same error message, when I set it to default. I tested it several times with fresh installations of Raspberry OS (I tested two different releases) and I even tested it with Ubuntu Server. The result is the same every time. – Mia Oct 3 '20 at 18:06
1

You've broken something. What? No idea... you say you've Changed the /etc/apt/sources.list, but you didn't say what you began with, or what you have now.

You should copy/backup the files you've created to a USB drive, download a fresh copy of RasPi OS, and re-flash your SD card.

  • I re-flashed the SD card several times and I get the same error with fresh setup. In order to check if the SD card is defect, I used another, new SD card and it results in the same hash sum mismatch error. – Mia Oct 3 '20 at 18:07
  • @Mia: My apologies, this should have worked. The only other possibility that occurs to me is that your DNS or router are sending you to the "wrong place". Maybe someone else here can comment on that? – Seamus Oct 3 '20 at 23:50
  • It could be a image file that is corrupt, have you checked the image file with sha? – Mats Karlsson Oct 4 '20 at 16:23
1

Try this:

sudo apt clean
sudo rm -rf /var/lib/apt/lists/*
sudo apt clean
sudo apt update
sudo apt upgrade
  • Pls read the OP's comment to my proposed answer. This would be useful as a first step, but do you think it's useful after re-flashing the SD card? – Seamus Oct 4 '20 at 16:12
  • If the OP have done it, it's more likely that there is a corrupted download of the image file or even more far fetched a repository that is corrupt. – Mats Karlsson Oct 4 '20 at 16:25
  • Unfortunately this doesn't help to fix the issue. I will check later if the image file is corrupt. But I think it is very unlikely because I tested 3 different images (2 different releases of Raspberry Pi OS and Ubuntu Server). Could it be a hardware problem? – Mia Oct 4 '20 at 17:06
0

I finally found the solution: Instead of using Ethernet, I connected the Raspberry Pi to my WiFi Network and apt update and apt upgrade runs smoothly.

Do you have any explanation for this strange behavior? This is not the first Pi which I connected to my local network via Ethernet. Never had such problems before.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.