首先,我是 Linux 命令行的新手。我以前从未使用过它。我的问题是该命令apt-get update
只会返回:
Err:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Temporary failure resolving 'us.archive.ubuntu.com'
Err:2 http://us.archive.ubuntu.com/ubuntu xenial-security InRelease
Temporary failure resolving 'us.archive.ubuntu.com'
Err:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
Temporary failure resolving 'us.archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'us.archive.ubuntu.com'
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'us.archive.ubuntu.com'
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'us.archive.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Run Code Online (Sandbox Code Playgroud)
我的sources.list
文件看起来像这样:
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #
#------------------------------------------------------------------------------#
###### Ubuntu Main Repos
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
Run Code Online (Sandbox Code Playgroud)
我的 ubuntu 版本是:
Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-66-generic x86_64)
Run Code Online (Sandbox Code Playgroud)
小智 15
我遇到过同样的问题。问题的核心是无法解析 DNS。我丢失了我的/etc/resolv.conf
文件。
它的内容应该是:
nameserver 8.8.8.8
nameserver 8.8.4.4
Run Code Online (Sandbox Code Playgroud)
之后,重新启动正确的界面(我的是lo
而不是eth0
)。您可以在/etc/network/interfaces
文件中找到它。
归档时间: |
|
查看次数: |
87800 次 |
最近记录: |