![无法在 Ubuntu 16.04 服务器中安装 Apache](https://linux22.com/image/903215/%E6%97%A0%E6%B3%95%E5%9C%A8%20Ubuntu%2016.04%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%AD%E5%AE%89%E8%A3%85%20Apache.png)
我在 Ubuntu 16.04 中安装 Apache2 之前执行命令sudo apt-get update
但出现错误(请看下文):
Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://ph.archive.ubuntu.com/ubuntu xenial InRelease
Temporary failure resolving 'ph.archive.ubuntu.com'
Err:3 http://ph.archive.ubuntu.com/ubuntu xenial-updates InRelease
Temporary failure resolving 'ph.archive.ubuntu.com'
Err:4 http://ph.archive.ubuntu.com/ubuntu xenial-backports InRelease
Temporary failure resolving 'ph.archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'ph.archive.ubuntu.com'
W: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'ph.archive.ubuntu.com'
W: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Temporary failure resolving 'ph.archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
希望您能立即对此问题作出答复。
谢谢。
答案1
现在一切正常;我只需设置 DNS 并重启网络即可。之后,我可以执行命令sudo apt-get update
,并且sudo apt-get install apache2
不会遇到任何错误。