我目前无法apt update在新的ubuntu:22.04(代号jammy)内运行。
$ docker --version
Docker version 20.10.2, build 2291f61
$ docker run --init --rm -it ubuntu:22.04
root@123456789:/# apt update
Run Code Online (Sandbox Code Playgroud)
$ docker run --init --rm -it ubuntu:22.04
root@6444bf2cb8b4:/# apt update
Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [90.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [90.7 kB]
Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [90.7 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 …Run Code Online (Sandbox Code Playgroud) 我在使用 apt 的 Ubuntu 18.04(仿生海狸)以及它处理可信密钥以验证存储库的方式上遇到了问题。
在 Ubuntu 14.04 上,我们曾经安装用于将我们的软件版本的存储库签名为/etc/apt/trusted.gpg.d. 通过这个 apt 知道密钥是可信的。
但是,这在 Ubuntu 18.04 上似乎不再适用。如果我在那里做同样的事情,我会在更新过程中收到错误:
# apt-get update
Hit:1 http://company.com/ubuntu-snapshot bionic InRelease
Reading package lists... Done
W: http://company.com/ubuntu-snapshot/dists/bionic/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/company-keys.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
Run Code Online (Sandbox Code Playgroud)
明显的尝试修复它
# sudo chown -v _apt /etc/apt/trusted.gpg.d/company-keys.gpg
changed ownership of '/etc/apt/trusted.gpg.d/company-keys.gpg' from root to _apt
Run Code Online (Sandbox Code Playgroud)
不起作用,因为apt-get update然后产生:
# apt-get update
Hit:1 http://company.com/ubuntu-snapshot bionic InRelease
Reading package lists... Done …Run Code Online (Sandbox Code Playgroud)