gpt4 book ai didi

apt-get 使用 Multipass 更新 Ubuntu 20.04 VM 时哈希和不匹配

转载 作者:行者123 更新时间:2023-12-03 15:58:12 26 4
gpt4 key购买 nike

我的问题如下:
我启动了一个新的多 channel VM,它是 Ubuntu 20.04 版本(我没有指定它,只是启动)。
我的新 VM 中的第一个命令是:sudo apt-get update我已经有一些错误的地方:

Err:6 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
Hash Sum mismatch
Hashes of expected file:
- Filesize:1291458 [weak]
- SHA256:407e1e5f8188d9a38dec308c87203aadb16cb4ac173b729005525c4d824317c9
- SHA1:47f50537ae094c725a60e90bf5e72d563a73abb2 [weak]
- MD5Sum:05500c05300ff2f3be66040cd9d4c24b [weak]
Hashes of received file:
- SHA256:fc9c8ae3385f3b2cdb7c52c8e4ee5fa5074c843155b7ce4786b3ce3c97fe8c3f
- SHA1:59b7721865c7a9c1b313ce11f11aefa4c7951fd4 [weak]
- MD5Sum:05500c05300ff2f3be66040cd9d4c24b [weak]
- Filesize:1291458 [weak]
Last modification reported: Mon, 28 Sep 2020 16:55:59 +0000
Release file created at: Tue, 29 Sep 2020 10:33:40 +0000
Get:7 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [69.3 kB]
Err:7 http://security.ubuntu.com/ubuntu focal-security/main Translation-en
Err:5 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
Hash Sum mismatch
Hashes of expected file:
- Filesize:8627544 [weak]
- SHA256:46a746dac789bd9537aca54db1680b9dff51c248153111350382199d7d96b9d1
- SHA1:7bce310e1f03066e04653926de275118ec09b4d9 [weak]
- MD5Sum:bc50840f4e1bbb64fb3ee6e8a351d744 [weak]
Hashes of received file:
- SHA256:b2f7c8b1b81060721c7f414843b41eda6760b7814fddeefd5abbf9f2bd4a9fd0
- SHA1:b07e3465964e50b87630eea2c05faff5253efa0d [weak]
- MD5Sum:bc50840f4e1bbb64fb3ee6e8a351d744 [weak]
- Filesize:8627544 [weak]
Last modification reported: Thu, 23 Apr 2020 17:34:17 +0000
Release file created at: Thu, 23 Apr 2020 17:33:17 +0000
Get:17 http://archive.ubuntu.com/ubuntu focal/universe Translation-en [5124 kB]
Err:17 http://archive.ubuntu.com/ubuntu focal/universe Translation-en
Get:18 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
Get:19 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [144 kB]
Get:20 http://archive.ubuntu.com/ubuntu focal/multiverse Translation-en [104 kB]
Err:20 http://archive.ubuntu.com/ubuntu focal/multiverse Translation-en
Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9136 B]
Get:22 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [375 kB]
Err:22 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
Hash Sum mismatch
Hashes of expected file:
- Filesize:374700 [weak]
- SHA256:35c0b5b9cdd324a81b1ee2c31610ca9c81779dd42df1393fcc1013a877a7f01c
- SHA1:380d462e7356a2ce3e1598f4588a5e5ff0afadff [weak]
- MD5Sum:73c1f287aab2928e8db81a62677faea6 [weak]
Hashes of received file:
- SHA256:6d8b94194f56ad754d1e2b04dbaa421c81a6b539bc045713b6ad0a0d40ffd340
- SHA1:be4ec3facb19f7272637f36337a050e5826335a3 [weak]
- MD5Sum:73c1f287aab2928e8db81a62677faea6 [weak]
- Filesize:374700 [weak]
Last modification reported: Tue, 29 Sep 2020 07:15:53 +0000
Release file created at: Tue, 29 Sep 2020 10:33:56 +0000
Get:23 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [142 kB]
Get:24 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [9876 B]
Get:25 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [43.6 kB]
Get:26 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [10.8 kB]
Get:27 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [175 kB]
Get:28 http://archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [92.7 kB]
Get:29 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [5952 B]
Get:30 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [11.6 kB]
Get:31 http://archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [3892 B]
Get:32 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [480 B]
Get:33 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [112 B]
Get:34 http://archive.ubuntu.com/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B]
Get:35 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [3088 B]
Get:36 http://archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [1448 B]
Get:37 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [224 B]
Get:38 http://archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]
Fetched 15.9 MB in 11s (1399 kB/s)
Reading package lists... Done
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/universe/binary-amd64/by-hash/SHA256/46a746dac789bd9537aca54db1680b9dff51c248153111350382199d7d96b9d1 Hash Sum mismatch
Hashes of expected file:
- Filesize:8627544 [weak]
- SHA256:46a746dac789bd9537aca54db1680b9dff51c248153111350382199d7d96b9d1
- SHA1:7bce310e1f03066e04653926de275118ec09b4d9 [weak]
- MD5Sum:bc50840f4e1bbb64fb3ee6e8a351d744 [weak]
Hashes of received file:
- SHA256:b2f7c8b1b81060721c7f414843b41eda6760b7814fddeefd5abbf9f2bd4a9fd0
- SHA1:b07e3465964e50b87630eea2c05faff5253efa0d [weak]
- MD5Sum:bc50840f4e1bbb64fb3ee6e8a351d744 [weak]
- Filesize:8627544 [weak]
Last modification reported: Thu, 23 Apr 2020 17:34:17 +0000
Release file created at: Thu, 23 Apr 2020 17:33:17 +0000
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/universe/i18n/by-hash/SHA256/a9c6ca6ce2913776bf753ae5132c7814139880784e98672525b4059c61f209dd
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/multiverse/i18n/by-hash/SHA256/224cafd684a26e8bce3dfca4daf33b853c9273d13e4ada6161ce9ef38f1a567c
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-amd64/by-hash/SHA256/35c0b5b9cdd324a81b1ee2c31610ca9c81779dd42df1393fcc1013a877a7f01c Hash Sum mismatch
Hashes of expected file:
- Filesize:374700 [weak]
- SHA256:35c0b5b9cdd324a81b1ee2c31610ca9c81779dd42df1393fcc1013a877a7f01c
- SHA1:380d462e7356a2ce3e1598f4588a5e5ff0afadff [weak]
- MD5Sum:73c1f287aab2928e8db81a62677faea6 [weak]
Hashes of received file:
- SHA256:6d8b94194f56ad754d1e2b04dbaa421c81a6b539bc045713b6ad0a0d40ffd340
- SHA1:be4ec3facb19f7272637f36337a050e5826335a3 [weak]
- MD5Sum:73c1f287aab2928e8db81a62677faea6 [weak]
- Filesize:374700 [weak]
Last modification reported: Tue, 29 Sep 2020 07:15:53 +0000
Release file created at: Tue, 29 Sep 2020 10:33:56 +0000
E: Failed to fetch store:/var/lib/apt/lists/partial/security.ubuntu.com_ubuntu_dists_focal-security_main_binary-amd64_Packages.xz Hash Sum mismatch
Hashes of expected file:
- Filesize:1291458 [weak]
- SHA256:407e1e5f8188d9a38dec308c87203aadb16cb4ac173b729005525c4d824317c9
- SHA1:47f50537ae094c725a60e90bf5e72d563a73abb2 [weak]
- MD5Sum:05500c05300ff2f3be66040cd9d4c24b [weak]
Hashes of received file:
- SHA256:fc9c8ae3385f3b2cdb7c52c8e4ee5fa5074c843155b7ce4786b3ce3c97fe8c3f
- SHA1:59b7721865c7a9c1b313ce11f11aefa4c7951fd4 [weak]
- MD5Sum:05500c05300ff2f3be66040cd9d4c24b [weak]
- Filesize:1291458 [weak]
Last modification reported: Mon, 28 Sep 2020 16:55:59 +0000
Release file created at: Tue, 29 Sep 2020 10:33:40 +0000
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/main/i18n/by-hash/SHA256/66c9979e0ab12165a3ab86f426e3e910d52933bce60ab14fa80a596e1733b0b3
E: Some index files failed to download. They have been ignored, or old ones used instead.
我已经尝试了我在网上找到的一些解决方案,但没有一个奏效。
解决方案1:
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update -o Acquire::CompressionTypes::Order::=gz
sudo apt-get update && sudo apt-get upgrade
解决方案2
sudo rm -rvf /var/lib/apt/lists/*
echo "APT::Cache-Limit "100000000";" >> /etc/apt/apt.conf.d/70debconf
解决方案3
sudo rm -rvf /var/lib/apt/lists/* 
&& sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
&& sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
&& sudo apt-get update
解决方案4
sudo apt-get autoclean && sudo apt-get autoremove -y && sudo apt-get update
解决方案5
sudo rm -rf /var/lib/apt/lists
sudo apt-get clean
sudo apt-get update
我还尝试添加 Ubuntu key 服务器:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16126D3A3E5C1192
这是我的 source.list
deb http://archive.ubuntu.com/ubuntu focal-updates main restricted
deb http://archive.ubuntu.com/ubuntu focal universe
deb http://archive.ubuntu.com/ubuntu focal-updates universe
deb http://archive.ubuntu.com/ubuntu focal multiverse
deb http://archive.ubuntu.com/ubuntu focal-updates multiverse
deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
我将不胜感激任何建议!
谢谢
ps:在我的 WSL2 上一切正常。

最佳答案

在我遇到同样问题的情况下,以下解决方案有效:

sudo su -
mkdir /etc/gcrypt
echo all >> /etc/gcrypt/hwf.deny
apt-get update
我的环境
视窗 10.0.19041.508
流浪者 2.2.10
VirtualBox 6.1.14r140239
ubuntu/focal64 Vagrant Box
我在这里找到了答案和解释:
askubuntu.com/questions/1235914/hash-sum-mismatch-error-due-to-identical-sha1-and-md5-but-different-sha256
我尝试安装 docker (get-docker.sh) 并得到非常相似的错误:“ 无法获取 https://download.docker.com ... Hash Sum 不匹配 ”。所以我认为这类问题与 VM 无关,而是与 Windows 10 主机有关。
我将 Hyper-V 启动类型更改为 off并重新启动系统:
bcdedit /set hypervisorlaunchtype off
我不太明白为什么,但这两个问题都消失了。

关于apt-get 使用 Multipass 更新 Ubuntu 20.04 VM 时哈希和不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64120030/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com