apt 镜像的问题

apt 镜像的问题

我已经使用 Ansible 自动化了一些系统。为了测试一切是否都是最新的并且正常工作,我每晚都会使用 test-kitchen 运行我的剧本。

为了使事情更有效率,我不会使用archive.ubuntu.com一些离我较近的镜子。

我尝试使用de.archive.ubuntu.com,但几乎每次 apt provisiong 都会因一些连接问题而失败。如果我重新运行该命令,一切都会正常。然后我尝试使用 apt mirrors autodetect 方法,但随后我收到一些错误,提示缺少一些公钥W: GPG error: http://extras.ubuntu.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192

过去我经常在选择镜像时遇到问题,而不是官方的archive.ubuntu.com

你知道这是什么原因吗?这是镜子本身的问题吗?

答案1

你可以尝试此方法相反,将以下内容放在文件顶部/etc/apt/sources.list

deb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt trusty-security main restricted universe multiverse

应该导致 apt 根据地理位置自动选择镜像。

相关内容