尝试安装 docker 时出现哈希总和不匹配错误

尝试安装 docker 时出现哈希总和不匹配错误

我在 VirtualBox 上运行 ubuntu 19.10。

当我运行以下命令来安装时docker-ce

sudo apt-get install docker-ce docker-ce-cli containerd.io

sudo apt-get install containerd.io

我收到哈希总和不匹配错误(见下文)。我仔细遵循了那里的所有步骤。不确定我是否遗漏了。

我见过这个答案并看着也一样,但没能得到太多。我是 ubuntu 新手。

我已经认真关注这个答案直到最后。

我在 Ubuntu 18.04 上也遇到了这个问题。我升级到了 19.10,希望这个问题能消失,但徒劳无功。

任何帮助,将不胜感激。

useradmin@ubuntuserver:~$ sudo apt-get install containerd.io
[sudo] password for vivekadmin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  containerd.io
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.1 MB of archives.
After this operation, 91.6 MB of additional disk space will be used.
Get:1 https://download.docker.com/linux/ubuntu eoan/stable amd64 containerd.io amd64 1.2.13-1 [20.1 MB]
Err:1 https://download.docker.com/linux/ubuntu eoan/stable amd64 containerd.io amd64 1.2.13-1
  Hash Sum mismatch
  Hashes of expected file:
   - SHA512:6d0224e484e515aa1f5409534174a0e8f446b681cdfbd0ec900217021d8f67348b56bb1964c66b300e24d084be3a06dd9df326900a07b3cc0daaf1f2503f6dfe
   - SHA256:4655707011b13bce3ac9c64b73096925bc863f64b8ab1d13aa316bce923181a0
   - SHA1:6c6a9e5d83ccd81e40b064b1418700e4027c4797 [weak]
   - MD5Sum:a564ecd3f499c32fa0d7679efeb1ac35 [weak]
   - Filesize:20122210 [weak]
  Hashes of received file:
   - SHA512:6e52d4d1e69ca5a4a3764c5e9068078022580d0561500b730e85e4dd9972f8bbf0efc3cd501e79a0f41a5b9689a8cd13888fff7ca2f8a0b324f54cc8a8419edf
   - SHA256:5a8ca72df78dfab8259346baed4000563fcaeb138bf27955e192b47a27573cb6
   - SHA1:bb28cb003a49915621a1ea6424569c8ecf03781b [weak]
   - MD5Sum:5b1847801ea188d60d39e7c18a47e6f3 [weak]
   - Filesize:20122210 [weak]
  Last modification reported: Tue, 03 Mar 2020 04:23:44 +0000
Fetched 20.1 MB in 34s (587 kB/s)
E: Failed to fetch https://download.docker.com/linux/ubuntu/dists/eoan/pool/stable/amd64/containerd.io_1.2.13-1_amd64.deb  Hash Sum mismatch
   Hashes of expected file:
    - SHA512:6d0224e484e515aa1f5409534174a0e8f446b681cdfbd0ec900217021d8f67348b56bb1964c66b300e24d084be3a06dd9df326900a07b3cc0daaf1f2503f6dfe
    - SHA256:4655707011b13bce3ac9c64b73096925bc863f64b8ab1d13aa316bce923181a0
    - SHA1:6c6a9e5d83ccd81e40b064b1418700e4027c4797 [weak]
    - MD5Sum:a564ecd3f499c32fa0d7679efeb1ac35 [weak]
    - Filesize:20122210 [weak]
   Hashes of received file:
    - SHA512:6e52d4d1e69ca5a4a3764c5e9068078022580d0561500b730e85e4dd9972f8bbf0efc3cd501e79a0f41a5b9689a8cd13888fff7ca2f8a0b324f54cc8a8419edf
    - SHA256:5a8ca72df78dfab8259346baed4000563fcaeb138bf27955e192b47a27573cb6
    - SHA1:bb28cb003a49915621a1ea6424569c8ecf03781b [weak]
    - MD5Sum:5b1847801ea188d60d39e7c18a47e6f3 [weak]
    - Filesize:20122210 [weak]
   Last modification reported: Tue, 03 Mar 2020 04:23:44 +0000
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

答案1

好的,我终于解决了,方法如下。

而不是命令

sudo apt-get install docker-ce docker-ce-cli containerd.io 

或者

sudo apt-get install containerd.io

我使用了以下步骤,首先下载软件包,然后安装它们。

curl -k -O -L https://download.docker.com/linux/ubuntu/dists/eoan/pool/stable/amd64/containerd.io_1.2.13-1_amd64.deb
curl -k -O -L https://download.docker.com/linux/ubuntu/dists/eoan/pool/stable/amd64/docker-ce-cli_19.03.8~3-0~ubuntu-eoan_amd64.deb
curl -k -O -L https://download.docker.com/linux/ubuntu/dists/eoan/pool/stable/amd64/docker-ce_19.03.8~3-0~ubuntu-eoan_amd64.deb


sudo apt install ./containerd.io_1.2.13-1_amd64.deb
sudo apt install ./docker-ce-cli_19.03.8~3-0~ubuntu-eoan_amd64.deb
sudo apt install ./docker-ce_19.03.8~3-0~ubuntu-eoan_amd64.deb

我先在网上搜索了一下,找到了软件包页面。例如这是 docker_ce 的链接

我发现apt install 不一致。

对我有用的另一种方法是

sudo dpkg -i ./packageName

相关内容