apt 在 ubuntu 18.04 上不起作用

apt 在 ubuntu 18.04 上不起作用

自从我安装了 18.04 后,我的网络调试就成了一场噩梦。我和它在一起已经一天了。

我真的不知道发生了什么。我可以访问一些网站,但不能访问其他网站。ping ubuntu.com可以工作但ping nba.com不能。在我的浏览器中,ubuntu.com它不起作用。apt update不起作用。当我进入 GUI 对话框时Software & UpdatesSelect best server没有提供服务器。


sudo apt update -y
Err:1 http://ppa.launchpad.net/webupd8team/atom/ubuntu bionic InRelease
  Connection failed [IP: 91.189.95.83 80]
Err:2 http://in.archive.ubuntu.com/ubuntu bionic InRelease
  Connection failed [IP: 91.189.88.162 80]
Err:3 http://in.archive.ubuntu.com/ubuntu bionic-security InRelease
  Connection failed [IP: 91.189.88.149 80]

但 ping91.189.88.83可以工作

ping 91.189.95.83
PING 91.189.95.83 (91.189.95.83) 56(84) bytes of data.
64 bytes from 91.189.95.83: icmp_seq=1 ttl=56 time=20.6 ms
64 bytes from 91.189.95.83: icmp_seq=2 ttl=56 time=18.7 ms
64 bytes from 91.189.95.83: icmp_seq=3 ttl=56 time=19.6 ms
64 bytes from 91.189.95.83: icmp_seq=4 ttl=56 time=19.2 ms


cat /etc/apt/sources.list
#------------------------------------------------------------------------------#
#                            OFFICIAL UBUNTU REPOS                             #
#------------------------------------------------------------------------------#


###### Ubuntu Main Repos
deb http://in.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://in.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse 
deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse


ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.0  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::28c:faff:fe8a:7cba  prefixlen 64  scopeid 0x20<link>
        ether 00:8c:fa:8a:7c:ba  txqueuelen 1000  (Ethernet)
        RX packets 198488  bytes 80931214 (80.9 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 148532  bytes 71462491 (71.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 238660  bytes 25150962 (25.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 238660  bytes 25150962 (25.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.9  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::5e82:7f12:37f8:854f  prefixlen 64  scopeid 0x20<link>
        ether 34:de:1a:7f:93:1a  txqueuelen 1000  (Ethernet)
        RX packets 29308  bytes 10218041 (10.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 15815  bytes 2638177 (2.6 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

cat /etc/netplan/01-netcfg.yaml 
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: yes
      dhcp6: yes
      addresses: [192.168.1.0/24, ]
      gateway4:  192.168.1.1
      nameservers:
              addresses: [192.168.1.1, 8.8.8.8, 8.8.4.4]

systemd-resolve --status
Global
         DNS Servers: 192.168.1.1
          DNSSEC NTA: 10.in-addr.arpa
                      16.172.in-addr.arpa
                      168.192.in-addr.arpa
                      17.172.in-addr.arpa
                      18.172.in-addr.arpa
                      19.172.in-addr.arpa
                      20.172.in-addr.arpa
                      21.172.in-addr.arpa
                      22.172.in-addr.arpa
                      23.172.in-addr.arpa
                      24.172.in-addr.arpa
                      25.172.in-addr.arpa
                      26.172.in-addr.arpa
                      27.172.in-addr.arpa
                      28.172.in-addr.arpa
                      29.172.in-addr.arpa
                      30.172.in-addr.arpa
                      31.172.in-addr.arpa
                      corp
                      d.f.ip6.arpa
                      home
                      internal
                      intranet
                      lan
                      local
                      private
                      test

Link 3 (wlan0)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.1.1

Link 2 (eth0)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 192.168.1.1
                      8.8.8.8
                      8.8.4.4

答案1

“连接失败”意味着服务已关闭,而不是您的网络配置有问题。

收到 ICMP(ping)的响应但 apt 拒绝连接只是意味着 Web 服务(而不是主机)已关闭。

如果您始终无法访问某些您知道在其他主机上运行的 Web 服务,则这些服务可能被路由器阻止。可能存在强制门户,您需要通过 Web 浏览器进行身份验证,或者路由器端需要进行其他配置。

您的报告中没有任何内容表明您配置的网络设置未正确应用于系统,但我们不知道它们是否是适合您环境的正确设置。

相关内容