我刚刚在一台较旧的 HP 裸机服务器上安装了 Ubuntu Server 20.04 LTS。我不得不更新 systemd 下的 resolv.conf 文件,但现在我可以 ping archive.ubuntu.com。我甚至可以 nslookup 它们并获得 dns 名称的解析。看来我肯定能成功。
我无法执行 apt-get update,因为它总是返回并说无法连接到网络。有人知道可能发生了什么吗?
我的两台电脑都没有防火墙。我有一台台式电脑在虚拟机中运行相同的 Ubuntu 服务器,除非它在 NAT 网络模式下运行,否则无法更新。当我以桥接网络模式运行它时,它无法更新。
# apt-get update
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out
Err:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Unable to connect to archive.ubuntu.com:http:
Err:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Unable to connect to archive.ubuntu.com:http:
Err:4 http://archive.ubuntu.com/ubuntu focal-security InRelease
Unable to connect to archive.ubuntu.com:http:
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease Unable to connect to archive.ubuntu.com:http:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease Unable to connect to archive.ubuntu.com:http:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-security/InRelease Unable to connect to archive.ubuntu.com:http:
W: Some index files failed to download. They have been ignored, or old ones used instead.
~$ nslookup archive.ubuntu.com
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: archive.ubuntu.com
Address: 91.189.88.152
Name: archive.ubuntu.com
Address: 91.189.88.142
Name: archive.ubuntu.com
Address: 2001:67c:1360:8001::24
Name: archive.ubuntu.com
Address: 2001:67c:1360:8001::23
~$ ping archive.ubuntu.com
PING archive.ubuntu.com (91.189.88.142) 56(84) bytes of data.
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=1 ttl=54 time=131 ms
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=2 ttl=54 time=131 ms
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=3 ttl=54 time=131 ms
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=4 ttl=54 time=131 ms
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=5 ttl=54 time=131 ms
64 bytes from aerodent.canonical.com (91.189.88.142): icmp_seq=6 ttl=54 time=131 ms
答案1
问题出在我们的网络上。如果 Windows 计算机是全新安装的,则它与 Ubuntu 系统存在同样的问题。它可以 ping 和解析域名,但没有 http 活动。我不知道设置是什么,但是当 Windows 系统添加到我们网络中的 Active Directory 域时,它被允许访问互联网,如果它未连接则无法访问。防火墙或本地 Windows 机器上没有代理,所以我不确定是什么阻止了它。我仍在尝试找出导致这种情况的设置。防火墙对此系统的 IP 开放,因此它是 Windows AD 世界中的东西,以及由 Windows 服务管理的网络服务(如 DHCP 和 DNS)。