apt-get 无法连接到 Ubuntu 档案库

apt-get 无法连接到 Ubuntu 档案库

我今天刚刚安装了最新版本的 Ubuntu 19.10,我决定做的第一件事就是安装 GNU Screen,使用sudo apt-get install screen。我的输出是:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package screen

我猜想软件包档案没有完全更新,因为这是一个全新安装,所以我尝试了一下sudo apt-get update。这是我得到的结果:

Get:1 http://security.ubuntu.com/ubuntu eoan-security InRelease [97.5 kB]      
Err:2 http://au.archive.ubuntu.com/ubuntu eoan InRelease
  Cannot initiate the connection to au.archive.ubuntu.com:80 (2001:388:30bc:cafe::beef). - connect (101: Network is unreachable) Could not connect to au.archive.ubuntu.com:80 (202.158.214.106), connection timed out
Err:3 http://au.archive.ubuntu.com/ubuntu eoan-updates InRelease   
  Cannot initiate the connection to au.archive.ubuntu.com:80 (2001:388:30bc:cafe::beef). - connect (101: Network is unreachable)
Err:4 http://au.archive.ubuntu.com/ubuntu eoan-backports InRelease
  Cannot initiate the connection to au.archive.ubuntu.com:80 (2001:388:30bc:cafe::beef). - connect (101: Network is unreachable)
Fetched 97.5 kB in 31s (3,106 B/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/eoan/InRelease  Cannot initiate the connection to au.archive.ubuntu.com:80 (2001:388:30bc:cafe::beef). - connect (101: Network is unreachable) Could not connect to au.archive.ubuntu.com:80 (202.158.214.106), connection timed out
W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/eoan-updates/InRelease  Cannot initiate the connection to au.archive.ubuntu.com:80 (2001:388:30bc:cafe::beef). - connect (101: Network is unreachable)
W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/eoan-backports/InRelease  Cannot initiate the connection to au.archive.ubuntu.com:80 (2001:388:30bc:cafe::beef). - connect (101: Network is unreachable)
W: Some index files failed to download. They have been ignored, or old ones used instead.

我真的不确定为什么它会这样做,除了第一次使用时可能出现一些小问题?计算机肯定连接到互联网,因为我正在那台机器上写这篇文章,我尝试在重新启动后运行命令,但仍然出现错误。我似乎根本无法连接到 au.archive.ubuntu.com。ping au.archive.ubuntu.com只是坐在那里没有回应。如果有人能帮忙,那就太好了!如果需要任何额外的信息,我很乐意将其编辑到问题中。

答案1

我刚刚在一位评论者的帮助下解决了这个问题。我必须进入“软件和更新”菜单,将“下载自:”菜单更改为主服务器。看来澳大利亚服务器确实出现了暂时性问题,而我的系统没有问题。

软件与更新

对于服务器安装,请参阅如何将 Ubuntu Server 中的镜像从区域镜像更改为主镜像?

答案2

我有同样的问题,

$ sudo apt update 
  Could not connect to in.archive.ubuntu.com:80 (*2403:8940:ffff::f*), connection timed out Could not connect to in.archive.ubuntu.com:80 (103.97.84.254), connection timed out
Err:8 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease
  Unable to connect to in.archive.ubuntu.com:http:
Err:9 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease
  Unable to connect to in.archive.ubuntu.com:http:

编辑/etc/apt/sources.list对我有用。要编辑,请运行

visudo /etc/apt/sources.list

你只需要将所有替换http://**xx**.archive.ubuntu.com/ubuntu...http://archive.ubuntu.com/ubuntu ...

就这样。重试

sudo apt update

答案3

在 ubunto 服务器中将 DNS 更改为 8.8.8.8

echo nameserver 8.8.8.8 | sudo tee /etc/resolv.conf

有用

答案4

我添加了针对同一错误的解决方案,以防其他人遇到与我相同的情况。

就我而言,问题在于配置错误/etc/hosts

我对文件中的所有内容进行了注释,然后它又可以正常工作了。

相关内容