我遇到了无法解决的问题。自从全新安装 ubuntu 18.04 以来,过去两个月我一直在使用开放网络。我刚刚转移到带代理的 LAN。我已完成所有设置,包括更新 /etc/resolv.conf 文件,并查看了其他此类解决方案。但都不起作用。
sudo apt-get update
Err:1 https://download.sublimetext.com apt/stable/ InRelease
Could not resolve 'download.sublimetext.com'
Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Could not resolve 'security.ubuntu.com'
Err:3 http://dl.google.com/linux/chrome/deb stable InRelease
Could not resolve 'dl.google.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic InRelease
Could not resolve 'archive.ubuntu.com'
Err:5 http://ppa.launchpad.net/leaeasy/dde/ubuntu bionic InRelease
Could not resolve 'ppa.launchpad.net'
Err:6 http://ppa.launchpad.net/maarten-baert/simplescreenrecorder/ubuntu bionic InRelease
Could not resolve 'ppa.launchpad.net'
Err:7 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Could not resolve 'archive.ubuntu.com'
Err:8 http://archive.ubuntu.com/ubuntu bionic-backports 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://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Could not resolve 'security.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://dl.google.com/linux/chrome/deb/dists/stable/InRelease Could not resolve 'dl.google.com'
W: Failed to fetch http://ppa.launchpad.net/leaeasy/dde/ubuntu/dists/bionic/InRelease Could not resolve 'ppa.launchpad.net'
W: Failed to fetch http://ppa.launchpad.net/maarten-baert/simplescreenrecorder/ubuntu/dists/bionic/InRelease Could not resolve 'ppa.launchpad.net'
W: Failed to fetch https://download.sublimetext.com/apt/stable/InRelease Could not resolve 'download.sublimetext.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
答案1
如果您的主机位于代理服务器后面,请尝试此操作。
将以下行添加到/etc/apt/apt.conf
。如果文件不存在,则创建一个。
Acquire::http::Proxy "http://yourproxyaddress:proxyport";
代替你的代理地址和代理端口适当地。
或者,如果需要身份验证:
Acquire::http::Proxy "http://user:pwd@yourproxyaddress:proxyport";