1

I was following a tutorial and as dumb as it sounds I was ended up with editing sources.list file and adding new gpg key. now when i'm updating the apt-get i'm getting this error. Any help to get me out of this is highly appreciated. Thanks

    Get:3 http://103.1.138.146/archive.raspberrypi.org/debian stretch/main armhf Packages [143 kB]
Err:3 http://103.1.138.146/archive.raspberrypi.org/debian stretch/main armhf Packages    
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:143052 [weak]
   - SHA256:f514a58006cec7fbbd43632402adb8dd532f1fa91572145425bb866d111bab97
   - SHA1:99e3c57149bc71c2f98651195880ac447aeca15b [weak]
   - MD5Sum:3c9ae8a120525bdbe6feba537c7e5826 [weak]
  Hashes of received file:
   - SHA256:5df39a393e9ffe012f7aa150b8a7035471954b5b3f433284643b72531e684ad9
   - SHA1:6c5dc4a721c4ba274cd726e7adf44fd43c83ebad [weak]
   - MD5Sum:59e2e01f65275244970812966d11bce8 [weak]
   - Filesize:142114 [weak]
  Last modification reported: Thu, 08 Mar 2018 12:00:36 +0000
  Release file created at: Mon, 12 Mar 2018 13:45:42 +0000
Fetched 167 kB in 2s (75.6 kB/s)    

$ cat /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

$ cat /etc/apt/sources.list.d/raspi.list 
deb http://archive.raspberrypi.org/debian/ stretch main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ stretch main ui

Following is the result when I manually download the Packages.gz file using wget

enter image description here

  • Comments are not for extended discussion; this conversation has been moved to chat. – Ghanima Mar 13 '18 at 6:41
1

For reference of others having the same problem. Any changes I did to the sources.list file did not worked. It' seems like the dns resolution of archive.raspberrypi.org redirected to some ip(103.1.138.146) which isn't getting the file with the expected hashsum. So I tried to update the apt offline. Using apt-offline utility I managed to update my rasp pi offline. (refer to [1] for steps)

After that apt-get update ran without an issue.

[1] https://www.maketecheasier.com/update-upgrade-ubuntu-without-internet-connection/

0

Try this:

sudo rm /var/lib/apt/lists/* -vf

then try again:

sudo apt-get update

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.