尝试构建以下 docker 镜像:
FROM ubuntu:22.04
RUN apt-get update
...
Run Code Online (Sandbox Code Playgroud)
使用以下命令:
sudo docker build -t ubuntu22 .
Run Code Online (Sandbox Code Playgroud)
但得到:
Fetched 22.0 MB in 2s (11.8 MB/s)
Reading package lists...
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
The command '/bin/sh -c apt-get update' returned a non-zero code: 100
Run Code Online (Sandbox Code Playgroud)
有什么问题吗?
我的印象是 Ubuntu 16.04 LTS 上的 ca 证书已经过时了。
今天我尝试做:
sudo apt update
sudo apt-get install apt-transport-https ca-certificates -y
Run Code Online (Sandbox Code Playgroud)
但没有更新:
Reading package lists... Done
Building dependency tree
Reading state information... Done
apt-transport-https is already the newest version (1.2.35).
ca-certificates is already the newest version (20210119~16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
Run Code Online (Sandbox Code Playgroud)
我对 Ubuntu 16.04 存储库具有过时证书的猜测是否正确?
如果是的话如何安装最新的?
(可能 Git 需要新证书,请参阅此处的完整故事)