ping google.comsudo apt update
ping google.com
ping: google.com: Temporary failure in name resolution
sudo apt update
 Err3: http://archive.ubuntu.com/ubuntu bionic InRelease
     Temporary failure in resolving 'archive.ubuntu.com'

更新时还有一些其他错误,但是它们都无法解析“ archive.ubuntu.com”。

/etc/netplan/01-netcfg.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s25:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.1.40/22]
      gateway4: 192.168.1.1
      nameservers:
        addresses: [8.8.4.4, 8.8.8.8, 1.1.0.0, 1.1.1.1]
/etc/resolv.confcatno such file or directory
/etc/resolv.confrun/systemd/resolve/resolv.conf/run/resolvconf/resolv.conf/run/run/systemd/network/10-netplan-enp0s25.network
[Match]
Name=enp0s25

[Network]
LinkLocalAddressing=ipv6
Address=192.198.1.40/22
Gateway=192.168.1.1
DNS=8.8.4.4
DNS=8.8.8.8
DNS=1.1.0.0
DNS=1.1.1.1
/etc/resolv.conf/run/systemd/network/10-netplan-enp0s25.networkresolv.conf10-netplan-enp0s25.network

我对配置机器还需要做些什么感到困惑。到目前为止,我发现的所有内容都非常矛盾,没有帮助。

最佳答案

/etc/resolv.conf/run/systemd/resolve/stub-resolv.confresolvconf/run/resolvconf/resolv.conf/run/systemd/resolve/stub-resolv.confsystemd-resolvedsystemctl status systemd-resolvedsudo systemctl enable systemd-resolved && sudo systemctl start systemd-resolved