尽管ping工作,apt-get仍然使用覆盆子pi失败

Yoc*_*mer 3 linux apt-get raspberry-pi raspbian

我正在尝试用我的覆盆子pi更新和安装东西.

不幸的是它失败了,我在做的时候遇到了这些错误sudo apt-get update:

Err http://raspberrypi.collabora.com wheezy Release.gpg
 Could not resolve 'host'
Err http://mirrordirector.raspbian.org wheezy Release.gpg
 Could not resolve 'host'
Err http://archive.raspberrypi.org wheezy Release.gpg
 Could not resolve 'host'
Err http://repository.wolfram.com wheezy Release.gpg
 Could not resolve 'host'
Run Code Online (Sandbox Code Playgroud)

还有更多这样的行......
奇怪的是,如果我ping这些地址,我会得到一个响应,所以我的DNS可能还可以:

ping mirrordirector.raspbian.org
Run Code Online (Sandbox Code Playgroud)

任何其他想法为什么会失败?当然,我该如何解决这个问题呢?

M-G*_*ire 12

我建议你用root(nano,vim,...)中最喜欢的文本编辑器编辑/etc/apt/sources.list ,然后编写:

#deb mirrordirector.raspbian.org/raspbian wheezy main contrib non-free rpi
deb http://archive.raspbian.org/raspbian wheezy main contrib non-free
deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free
Run Code Online (Sandbox Code Playgroud)

#符号只是在sources.list中注释掉一行的方式

完成后,下载公钥并使用以下命令安装它:

wget http://archive.raspbian.org/raspbian.public.key -O - | sudo apt-key add -
Run Code Online (Sandbox Code Playgroud)

如果有任何问题,请发送输出:).

祝好运