ubuntu 16 服务器上 Microsoft 程序包的哈希和不匹配

Hash Sum Mismatch for microsoft packages on ubuntu 16 server

我在 运行 apt 更新时遇到以下错误:

E: Failed to fetch https://packages.microsoft.com/ubuntu/16.04/prod/dists/xenial/main/binary-amd64/Packages.bz2 Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.

在有人认为这已经得到解答之前,我已经尝试了所有给出的解决方案,但其中 none 有效: 我尝试过的解决方案:

#solution1
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update

#solution2
sudo apt-get clean
sudo apt-get update

#solution3
sudo rm -rf /var/lib/apt/lists/partial
sudo apt-get update -o Acquire::CompressionTypes::Order::=gz

#solution4
sudo sed -i -re 's/\w+\.archive\.ubuntu\.com/archive.ubuntu.com/g' /etc/apt/sources.list

通过 Microsoft 支持,他们发现他们的 linux 存储库存在问题。它已经 fixed/rolled 回来了。我遇到了同样的问题,但现在它又对我有用了。