版本 18.04 sudo apt-get update
我正在尝试“更新”,但收到以下消息:
Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Could not resolve 'archive.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Could not resolve 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Could not resolve 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Could not resolve 'archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-security/InRelease Could not resolve 'archive.ubuntu.com'
W: Some index files failed to download. They have been ignored, or cold ones used instead.
我尝试过各种解决方案但无法解决。
我尝试使用以太网进行更新,以防万一是 wifi 的问题。但仍然出现同样的错误。
我曾尝试做过以下事情:
echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/nell
但得到
tee: /etc/resolvconf/resolv.conf.d/base: No such file or directory
答案1
我认为你的思路是对的。
Could not resolve 'archive.ubuntu.com'
表示存在某种网络问题,可能是 DNS 故障。
也许我们应该先研究一下以太网(大多数情况下,wifi 应该可以开箱即用,但有些芯片组存在问题)。
在 ubuntu 中使用网络管理器,我们检查 GUI 中的设置:
打开网络设置
1.1. 按 Windows 键
1.2. 类型
settings
1.3. 转至
Network
底部是否
Wired
显示已连接?
- 配置(单击
gear
图标后)看起来合理吗?
您可以将您的 DNS 设置放在该IPv4
选项卡中。
我使用的是 ubuntu 18.10,但除了主题不同之外,18.04 应该看起来类似