我一直在 M1 上通过 UTM 使用 Ubuntu 20.04,最近由于需要它,我安装了 Ubuntu 18.04。
问题是,虽然我在 20.04 上没有遇到网络连接问题,但在 18.04 上却没有网络连接。我发现一个有趣的事情是,互联网似乎在“控制台界面”下工作,因为我可以sudo apt update
毫无问题地运行,但如果我在“图形界面”下运行它,错误代码如下:
Err:1 http://kr.ports.ubuntu.com/ubuntu-ports bionicInRelease
Could not resolve 'kr.ports.ubuntu.com'
Err:2 http://kr .ports.ubuntu.com/ubuntu-ports bionic-updates InRelease
Could not resolve 'kr.ports.ubuntu.com'
Err:3 http://kr.ports.ubuntu.com/ubuntu-ports bionic-backports InRelease
Could not resolve 'kr.ports.ubuntu.com'
Err:4 http: //ports.ubuntu.com/ubuntu-ports bionic-security InRelease
Could not resolve 'ports.ubuntu.com'
Reading package lists... Done
Building dependency tree
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch http://kr.ports.ubuntu.com/ubuntu-ports/dists/bionic/InReleas
e Could not resolve 'kr.ports.ubuntu.com'
W: Failed to fetch http://kr.ports.ubuntu.com/ubuntu-ports/dists/bionic-updates/InRelease
Could not resolve 'kr.ports.ubuntu.com'
W: Failed to fetch http: //kr.ports.ubuntu.com/ubuntu-ports/dists/bionic-backports/InRelease
Could not resolve 'kr.ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-security/InRelease
Could not resolve 'ports. ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead
首先我尝试sudo apt update
通过在和中分别添加dns-nameservers 8.8.8.8 8.8.4.4
和来解决上述错误,但仍然无法解决问题。nameserver 8.8.8.8
nameserver 8.8.4.4
$ sudo nano /etc/network/interfaces
$ vi /etc/resolv.conf
然后我检查了lshw -C network
18.04 和 20.04,输出几乎相同,只是18.04 的输出最后一行ip
缺少 和link=no
而不是。yes
@tro:~$ lshw -C network
WARNING: you should run this program as super-user.
*-network
description: Ethernet controller
product: Virtio network device
vendor: Red Hat, Inc.
physical id: a
bus info: pci@0000:00:0a.0
version: 00
width: 64 bits
clock: 33MHz
capabilities: bus_master cap_list rom
configuration: driver=virtio-pci latency=0
resources: irq:39 ioport:1140(size=32) memory:1005f000-1005ffff memory:10054000-10057fff memory:10000000-1003ffff
*-virtio3 DISABLED
description: Ethernet interface
physical id: 0
bus info: virtio@3
logical name: enp0s10
serial: e6:a6:51:a2:02:a0
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=virtio_net driverversion=1.0.0 link=no multicast=yes
我一直在努力解决这个问题,真心希望尽快解决这个问题......