【问题标题】:Error by trying installing docker repository on linux ubuntu 18.04 LTS尝试在 linux ubuntu 18.04 LTS 上安装 docker 存储库时出错
【发布时间】:2019-07-20 22:58:06
【问题描述】:

抱歉,语言是德语。

所以我添加了docker的仓库:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

但是当我更新源时出现错误:

sudo apt-get update

Ign:3 https://download.docker.com/linux/ubuntu仿生InRelease

Fehl:4 https://download.docker.com/linux/ubuntu 仿生释放
证书验证失败:证书不受信任。这 证书颁发者未知。无法握手:错误 证书验证。 [IP:54.230.93.95 443]

Holen:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74,6 KB]

OK:6 http://archive.ubuntu.com/ubuntubionic-security InRelease

Paketlisten werden gelesen... Fertig E: Das Depot »https://download.docker.com/linux/ubuntu仿生释放« enthält keine 发布日期。

N: Eine Aktualisierung von solch einem Depot kann nicht auf eine sichere Art durchgeführt werden, daher ist es standardmäßig deaktiviert。

N: Weitere Details zur Erzeugung von Paketdepots sowie zu deren Benutzerkonfiguration finden Sie in der Handbuchseite apt-secure(8)。

【问题讨论】:

  • 是的。如您所见,存储库无法刷新,并且我需要存储库来下载 docker-ce ,因为没有存储库,它会向我显示:在编写 sudo apt-get install docker-ce 后,我收到一条消息说 docker-ce 不存在并且从另一个数据包源尝试
  • Certificate verification failed 您是否按照Install using the repository 中的步骤进行操作?? curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -apt-key fingerprint 0EBFCD88 ?
  • 是的,我做到了。首先我没问题,当我检查指纹时:apt-key指纹0EBFCD88 pub rsa4096 2017-02-22 [SCEA] 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 uid [未知] Docker Release (CE deb) sub rsa4096 2017-02-22 [S] 看起来一切都很好
  • 更多信息'curl -kv -fsSL download.docker.com/linux/ubuntu/gpg | sudo apt-key add -' Trying 54.192.130.134... 连接到 download.docker.com (54.192.130.134) 端口 443 (#0) ALPN,提供 h2 成功设置证书验证位置:ALPN,服务器不同意协议** 服务器证书:SSL 证书验证结果:无法获取本地颁发者证书(20),仍然继续。] GET /linux/ubuntu/gpg HTTP/1.1 主机:download.docker.com

标签: linux docker ubuntu


【解决方案1】:

对于那些仍然有这个问题的人,这是我从Ubuntu manpages 收集的一个解决方案。

OP的帖子指出证书验证错误:

Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 54.230.93.95 443]

我在位于公司代理后面的虚拟机上遇到了类似的问题。代理充当中间人,在流量流经代理时对其进行解密和重新加密。即使我在我的虚拟机上为代理安装了受信任的证书,这个错误仍然发生,这是由无效的 OCSP 响应引起的。为了修复它,我运行了这个命令:

touch /etc/apt/apt.conf.d/99verify-peer.conf \
&& echo >>/etc/apt/apt.conf.d/99verify-peer.conf "Acquire { https::Verify-Peer false }"

这会禁用 apt 的 OCSP 验证,不推荐使用。

我选择了其他解决方案,其他人可能无法使用。我们公司为这样的用例维护了一个非解密代理,所以我转而使用它。

【讨论】:

  • 能否告诉我,如何开启证书验证?
  • 由于我不知道它是如何为你关闭的,我只能建议你尝试这个命令:touch /etc/apt/apt.conf.d/99verify-peer.conf \ && echo >>/etc/apt/apt.conf.d/99verify-peer.conf "获取 { https::Verify-Peer true }"
  • 就像一个魅力。谢谢@WPWoodJr
猜你喜欢
  • 2019-05-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-05-09
  • 1970-01-01
  • 2019-10-06
相关资源
最近更新 更多