安装 OpenSSH 时出现错误:
Err:2 http://security.ubuntu.com/ubuntu xenial-security/main i386
openssh-server i386 1:7.2p2-4ubuntu2.7 Could not resolve
'security.ubuntu.com' E: Failed to fetch
http://security.ubuntu.com/ubuntu/pool/main/o/openssh/openssh-sftp-server_7.2p2-4ubuntu2.7_i386.deb
Could not resolve 'security.ubuntu.com'
E: Failed to fetch
http://security.ubuntu.com/ubuntu/pool/main/o/openssh/openssh-server_7.2p2-4ubuntu2.7_i386.deb
Could not resolve 'security.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with
--fix-missing?
答案1
我认为您无法访问 DNS 服务器,导致无法解析“security.ubuntu.com”的主机名
如果你知道你的 DNS IP,你可以编辑 /etc/resolv.conf 并在变量 nameserver 上设置 DNS IP
编辑正确的 DNS:例如
nameserver 8.8.8.8
如果再次不起作用,请重新启动然后就好了。