vscode: Failed to fetch due to Hash sum mismatch

When I was trying to update, I got the Hash sum mismatch error on terminal.

  • VSCode Version:1.40.2
  • OS Version:Ubuntu LTS 18.04 (Linux x64 5.0.0-37-generic)

Steps to Reproduce:

1.sudo apt update at terminal 2.Get the following error log

E: Failed to fetch http://packages.microsoft.com/repos/vscode/dists/stable/main/binary-amd64/Packages.bz2  File has unexpected size (156056 != 156065). Mirror sync in progress? [IP: 10.77.8.70 8080]
   Hashes of expected file:
    - Filesize:156065 [weak]
    - SHA512:12e6dffcd247d1ff067acfa61a3c4eb6078c326c2858feb4f6f141a1d809e22292a78282414a5c103038ea80bb63cd734c7516782c9809c341335083d4e7611b
    - SHA256:c850f35f1979831ac75641978c397e51519fa22313598ec12bde5f52277044c0
    - SHA1:1f65f4a7388c22bcf7b7f30fb7bc337c60d94b2e [weak]
    - MD5Sum:4153a12e4a5629bfb14ed98f4c8ac234 [weak]
   Release file created at: Thu, 12 Dec 2019 19:59:19 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.

Previously:

#70584 #66339 #66238 #41117

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 81
  • Comments: 93 (5 by maintainers)

Most upvoted comments

@rpellerin Maybe not. It does increase the noise, I agree, but it’s a great metric of how pervasive the problem is. Unless we have a voting/input system of sorts (“Yes, I have this problem, too!”), the number and intensity of comments is the only way 😃

Ok maybe people should stop posting messages such as “Same on <platform>”. I guess at this point they know most (if not all) Debian-based distros are affected.

Also seeing this, same version of VSCode and Ubuntu as OP.

In #41094 (almost 2 years ago), @Tyriar said “the team is planning on putting together better monitoring to hopefully catch this sort of thing earlier.”

Apparently whatever was planned didn’t go so well? Maybe some automation is needed?

I’ve contacted the linux repo team about this and am waiting for them to resolve it.

I love all the people chiming in with “I’m having the same issue on [distro] v[XX.xx] [desktop environment] as well!” Yes, you’re all going to have the issue. The vscode team screwed up their PGP key. It’s not going to work for any of us until they fix the key. It will probably be resolved by tomorrow, because it’s not that difficult of a fix. So just manually ignore the vscode update until it’s fixed. If you don’t know how to do that, read this

Edit: Here’s a more comprehensive guide to ignoring repos, if you’re interested. https://www.tecmint.com/disable-lock-blacklist-package-updates-ubuntu-debian-apt/

And oh, I’m too having this problem with Xubuntu 18.04. 😆

Fixed 😃

Same 19.10

I’ve the same issue on Ubuntu 18.04.3 and 16.04.6 LTS.

Same here. Ubuntu 18.04.3.

Reading package lists… Done N: Skipping acquire of configured file ‘contrib/binary-i386/Packages’ as repository ‘https://download.virtualbox.org/virtualbox/debian bionic InRelease’ doesn’t support architecture ‘i386’ E: Failed to fetch https://packages.microsoft.com/repos/vscode/dists/stable/main/binary-amd64/Packages.bz2 File has unexpected size (156056 != 156065). Mirror sync in progress? [IP: 40.76.35.62 443] Hashes of expected file: - Filesize:156065 [weak] - SHA512:12e6dffcd247d1ff067acfa61a3c4eb6078c326c2858feb4f6f141a1d809e22292a78282414a5c103038ea80bb63cd734c7516782c9809c341335083d4e7611b - SHA256:c850f35f1979831ac75641978c397e51519fa22313598ec12bde5f52277044c0 - SHA1:1f65f4a7388c22bcf7b7f30fb7bc337c60d94b2e [weak] - MD5Sum:4153a12e4a5629bfb14ed98f4c8ac234 [weak] Release file created at: Thu, 12 Dec 2019 19:59:19 +0000 E: Some index files failed to download. They have been ignored, or old ones used instead.

$ software-properties-gtk -> other software window -> remove Microsoft link $ sudo apt-get update

FYI for a little more transparency, this happened because changes were pushed to the system that drives https://packages.microsoft.com/ (for the majority of MS Linux offerings) and they caused issues with metadata sync. We have similar issues periodically where some repo files don’t regenerate without their team doing some manual intervention. Unfortunately all we (the VS Code team) can do is ping them when things go wrong and hope that the underlying problems get fixed eventually.

Same with Ubuntu 16.04

It seems the signed release file http://packages.microsoft.com/repos/vscode/dists/stable/InRelease (InRelease) is old and does not match the files on the repo.

URL=http://packages.microsoft.com/repos/vscode/dists/stable

curl -s $URL/InRelease | grep Packages.bz2 |head -1
 4153a12e4a5629bfb14ed98f4c8ac234   156065 main/binary-amd64/Packages.bz2   <-- wrong size
curl -s $URL/Release | grep Packages.bz2 |head -1
 de01bf2799b61b2a6eb891b6c6f173e1   156354 main/binary-amd64/Packages.bz2   <-- ok
curl -s -I $URL/main/binary-amd64/Packages.bz2 | grep Length
Content-Length: 156354   <-- real size

curl -s $URL/InRelease | grep Date
Date: Thu, 12 Dec 2019 19:59:19 UTC   <--- older
curl -s $URL/Release | grep Date
Date: Fri, 13 Dec 2019 14:15:54 UTC   <-- newer

For all people trying to help by saying “remove the vscode.list file” don’t forget, the issue created here is a vscode (Microsoft (as it applies to dotnet-core as well)) issue, not an apt issue, and removing the .list file will only allow us to update all other packages, vscode won’t be updated unless the vscode.list file exists and works. (Yes I know we can install the update using the .deb, but that is not the issue here either)

Yeah, I am absolutely clear what the problem is, but also know how to solve it. But I still come here and write down “Same on …”. This is just a euphemism to express: “Hey, you guys screwed up again.” Yeah, again and again. You guys represent a great software company. Don’t let me so dispoint. Just setup an automated test please.

Reporting in with the same issue. Ubuntu 18.04.3

Ditto. Ubuntu 18.04.

E: Failed to fetch http://packages.microsoft.com/repos/vscode/dists/stable/main/binary-amd64/Packages.bz2 File has unexpected size (156056 != 156065). Mirror sync in progress? [IP: 40.76.35.62 80] Hashes of expected file: - Filesize:156065 [weak] - SHA512:12e6dffcd247d1ff067acfa61a3c4eb6078c326c2858feb4f6f141a1d809e22292a78282414a5c103038ea80bb63cd734c7516782c9809c341335083d4e7611b - SHA256:c850f35f1979831ac75641978c397e51519fa22313598ec12bde5f52277044c0 - SHA1:1f65f4a7388c22bcf7b7f30fb7bc337c60d94b2e [weak] - MD5Sum:4153a12e4a5629bfb14ed98f4c8ac234 [weak] Release file created at: Thu, 12 Dec 2019 19:59:19 +0000 E: Some index files failed to download. They have been ignored, or old ones used instead.

same thing here Linux Mint 19.2 Cinnamon

Same here, Ubuntu 19.10

@rpellerin Maybe not. It does increase the noise, I agree, but it’s a great metric of how pervasive the problem is. Unless we have a voting/input system of sorts (“Yes, I have this problem, too!”), the number and intensity of comments is the only way 😃

At least people should look for duplicates and thumb up messages mentioning their own distro instead of re-posting.

It is everywhere now 😃… I have removed the vscode sources for now until this is fixed. sudo rm /etc/apt/sources.list.d/vscode.list

Was with the same problem, apparently normalized.

Looks like this might be fixed

Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Get:5 https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease [4,003 B]
Get:6 https://packages.microsoft.com/ubuntu/16.04/prod xenial/main amd64 Packages [110 kB]
Hit:7 https://packages.gitlab.com/runner/gitlab-runner/ubuntu xenial InRelease
Fetched 440 kB in 1s (232 kB/s)
Reading package lists... Done

I receive the exact error in Linux Mint 19.2 Tina

Same error with Linux Mint 19.1 Tessa

mint 19.2

Debian 10

Simply remove removed the vscode sources for now and add when it is fixed. sudo rm /etc/apt/sources.list.d/vscode.list

dotnet core is affected too by this fuck up: dotnet/core#3988

Ubuntu 18.04 x64: vscode-bug-sugestao

Also having the same issues installing msodbcsql17 on debian buster

Same problem on Elementary OS 5.1

Earlier from @RMacfarlane:

I’ve contacted the linux repo team about this and am waiting for them to resolve it.

Pinging @sbatten as endgame master for this release. This seems to be taking a long time to resolve, and is resulting in a lot of dup issues. The bot isn’t doing a great job of spotting them either.

Same error occurring during update on Ubuntu 18.04.

`Err:11 http://packages.microsoft.com/repos/vscode stable/main amd64 Packages
File has unexpected size (156354 != 156065). Mirror sync in progress? [IP: 13.76.190.189 80] Hashes of expected file:

  • Filesize:156065 [weak]
  • SHA512:12e6dffcd247d1ff067acfa61a3c4eb6078c326c2858feb4f6f141a1d809e22292a78282414a5c103038ea80bb63cd734c7516782c9809c341335083d4e7611b
  • SHA256:c850f35f1979831ac75641978c397e51519fa22313598ec12bde5f52277044c0
  • SHA1:1f65f4a7388c22bcf7b7f30fb7bc337c60d94b2e [weak]
  • MD5Sum:4153a12e4a5629bfb14ed98f4c8ac234 [weak] Release file created at: Thu, 12 Dec 2019 19:59:19 +0000 `

Same here 😦 Ubuntu 18.04

Same problem with Linux Mint 19.

https://packages.microsoft.com/repos/vscode/dists/stable/InRelease https://packages.microsoft.com/repos/vscode/dists/stable/Release In these files values changed for

Origin: vscode stable
Label: vscode stable
Suite: stable
Codename: stable

That’s probably why there are hash sum mismatches.

Ubuntu 19.10 here, however, I updated successfully within 30 minutes of the 1.41 release on my work PC which is also Ubuntu 19.10. getting the error now on my laptop. (Was able to install using the .deb. but still can’t update using apt)

I am getting the issue for the dotnet core apt repo as well, so it might be microsofts servers…

[/etc/apt/sources.list.d]:$ ll
total 32K
-rw-r--r-- 1 root root  189 Oct 22 21:45 google-chrome.list
-rw-r--r-- 1 root root   50 Oct 22 21:45 insomnia.list
-rw-r--r-- 1 root root   76 Oct 22 21:45 linuxgndu-ubuntu-sqlitebrowser-eoan.list
-rw-r--r-- 1 root root   77 May  7  2019 microsoft-prod.list
-rw-r--r-- 1 root root   73 Oct 22 21:45 pgdg.list
-rw-r--r-- 1 root root 1.2K Oct 22 21:45 teamviewer.list
-rw-r--r-- 1 root root   67 Oct 22 21:45 teejee2008-ubuntu-ppa-eoan.list
-rw-r--r-- 1 root root  193 Dec 13 00:23 vscode.list

[/etc/apt/sources.list.d]:$ cat vscode.list 
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main

[/etc/apt/sources.list.d]:$ cat microsoft-prod.list 
deb [arch=amd64] https://packages.microsoft.com/ubuntu/19.04/prod disco main

[/etc/apt/sources.list.d]:$ sudo apt update 
Hit:1 http://us.archive.ubuntu.com/ubuntu eoan InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu eoan-updates InRelease                             
Hit:3 http://us.archive.ubuntu.com/ubuntu eoan-backports InRelease                           
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease                                 
Get:5 http://packages.microsoft.com/repos/vscode stable InRelease [3,959 B]                  
Get:6 https://packages.microsoft.com/ubuntu/19.04/prod disco InRelease [3,959 B]             
Get:7 http://security.ubuntu.com/ubuntu eoan-security InRelease [97.5 kB]                    
Hit:8 http://dl.google.com/linux/chrome/deb stable Release                                   
Ign:9 https://dl.bintray.com/getinsomnia/Insomnia  InRelease                                 
Get:10 https://dl.bintray.com/getinsomnia/Insomnia  Release [815 B]                          
Get:11 http://packages.microsoft.com/repos/vscode stable/main amd64 Packages [156 kB]        
Err:11 http://packages.microsoft.com/repos/vscode stable/main amd64 Packages              
  File has unexpected size (156056 != 156065). Mirror sync in progress? [IP: 40.76.35.62 80]
  Hashes of expected file:
   - Filesize:156065 [weak]
   - SHA512:12e6dffcd247d1ff067acfa61a3c4eb6078c326c2858feb4f6f141a1d809e22292a78282414a5c103038ea80bb63cd734c7516782c9809c341335083d4e7611b
   - SHA256:c850f35f1979831ac75641978c397e51519fa22313598ec12bde5f52277044c0
   - SHA1:1f65f4a7388c22bcf7b7f30fb7bc337c60d94b2e [weak]
   - MD5Sum:4153a12e4a5629bfb14ed98f4c8ac234 [weak]
  Release file created at: Thu, 12 Dec 2019 19:59:19 +0000
Hit:12 http://linux.teamviewer.com/deb stable InRelease                   
Get:13 https://packages.microsoft.com/ubuntu/19.04/prod disco/main amd64 Packages [156 kB]
Err:13 https://packages.microsoft.com/ubuntu/19.04/prod disco/main amd64 Packages
  File has unexpected size (23655 != 156065). Mirror sync in progress? [IP: 40.76.35.62 443]
  Hashes of expected file:
   - Filesize:156065 [weak]
   - SHA512:12e6dffcd247d1ff067acfa61a3c4eb6078c326c2858feb4f6f141a1d809e22292a78282414a5c103038ea80bb63cd734c7516782c9809c341335083d4e7611b
   - SHA256:c850f35f1979831ac75641978c397e51519fa22313598ec12bde5f52277044c0
   - SHA1:1f65f4a7388c22bcf7b7f30fb7bc337c60d94b2e [weak]
   - MD5Sum:4153a12e4a5629bfb14ed98f4c8ac234 [weak]
  Release file created at: Thu, 12 Dec 2019 19:59:19 +0000
Hit:14 http://apt.postgresql.org/pub/repos/apt eoan-pgdg InRelease
Fetched 102 kB in 1s (86.6 kB/s)
Reading package lists... Done
W: Conflicting distribution: https://packages.microsoft.com/ubuntu/19.04/prod disco InRelease (expected disco but got stable)
E: Failed to fetch http://packages.microsoft.com/repos/vscode/dists/stable/main/binary-amd64/Packages.bz2  File has unexpected size (156056 != 156065). Mirror sync in progress? [IP: 40.76.35.62 80]
   Hashes of expected file:
    - Filesize:156065 [weak]
    - SHA512:12e6dffcd247d1ff067acfa61a3c4eb6078c326c2858feb4f6f141a1d809e22292a78282414a5c103038ea80bb63cd734c7516782c9809c341335083d4e7611b
    - SHA256:c850f35f1979831ac75641978c397e51519fa22313598ec12bde5f52277044c0
    - SHA1:1f65f4a7388c22bcf7b7f30fb7bc337c60d94b2e [weak]
    - MD5Sum:4153a12e4a5629bfb14ed98f4c8ac234 [weak]
   Release file created at: Thu, 12 Dec 2019 19:59:19 +0000
E: Failed to fetch https://packages.microsoft.com/ubuntu/19.04/prod/dists/disco/main/binary-amd64/Packages.bz2  File has unexpected size (23655 != 156065). Mirror sync in progress? [IP: 40.76.35.62 443]
   Hashes of expected file:
    - Filesize:156065 [weak]
    - SHA512:12e6dffcd247d1ff067acfa61a3c4eb6078c326c2858feb4f6f141a1d809e22292a78282414a5c103038ea80bb63cd734c7516782c9809c341335083d4e7611b
    - SHA256:c850f35f1979831ac75641978c397e51519fa22313598ec12bde5f52277044c0
    - SHA1:1f65f4a7388c22bcf7b7f30fb7bc337c60d94b2e [weak]
    - MD5Sum:4153a12e4a5629bfb14ed98f4c8ac234 [weak]
   Release file created at: Thu, 12 Dec 2019 19:59:19 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.