使用 root 权限,我编辑/etc/resolv.conf
要添加的 内容nameserver 8.8.8.8
。保存文件给我
"/etc/resolv.conf" E166: Can't open linked file for writing
您有什么想法吗?我想进行编辑,resolv.conf
因为 apt-get update 不起作用。
编辑 我正在使用 18.04 LTS 操作系统。
Err:1 http://ir.archive.ubuntu.com/ubuntu bionic InRelease
Could not resolve 'ir.archive.ubuntu.com'
Err:2 http://ir.archive.ubuntu.com/ubuntu bionic-updates InRelease
Could not resolve 'ir.archive.ubuntu.com'
Err:3 http://ir.archive.ubuntu.com/ubuntu bionic-backports InRelease
Could not resolve 'ir.archive.ubuntu.com'
Err:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
Could not resolve 'security.ubuntu.com'
Err:5 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease
Could not resolve 'ppa.launchpad.net'
Reading package lists... Done
W: Failed to fetch http://ir.archive.ubuntu.com/ubuntu/dists/bionic/InRelease Could not resolve 'ir.archive.ubuntu.com'
W: Failed to fetch http://ir.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Could not resolve 'ir.archive.ubuntu.com'
W: Failed to fetch http://ir.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Could not resolve 'ir.archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Could not resolve 'security.ubuntu.com'
W: Failed to fetch http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu/dists/bionic/InRelease Could not resolve 'ppa.launchpad.net'
W: Some index files failed to download. They have been ignored, or old ones used instead.
答案1
我重置了系统并以图形方式登录。我不知道为什么,但它解决了问题。我不再编辑了resolve.conf
。