但是當執行 sudo apt-get update 時, 總是會遇到錯誤,
錯誤如下,
========================================================================
pi@raspberrypi:/etc/network$ sudo apt-get update
Err http://mirrordirector.raspbian.org jessie InRelease
Err http://archive.raspberrypi.org jessie InRelease
Err http://mirrordirector.raspbian.org jessie Release.gpg
Cannot initiate the connection to mirrordirector.raspbian.org:80 (2001:41c9:1:3ce::11). - connect (101: Network is unreachable) [IP: 2001:41c9:1:3ce::11 80]
Err http://archive.raspberrypi.org jessie Release.gpg
Cannot initiate the connection to archive.raspberrypi.org:80 (2a00:1098:0:82:1000:13:0:5). - connect (101: Network is unreachable) [IP: 2a00:1098:0:82:1000:13:0:5 80]
Reading package lists... Done
W: Failed to fetch http://mirrordirector.raspbian.org/raspbian/dists/jessie/InRelease
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/jessie/InRelease
W: Failed to fetch http://mirrordirector.raspbian.org/raspbian/dists/jessie/Release.gpg Cannot initiate the connection to mirrordirector.raspbian.org:80 (2001:41c9:1:3ce::11). - connect (101: Network is unreachable) [IP: 2001:41c9:1:3ce::11 80]
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/jessie/Release.gpg Cannot initiate the connection to archive.raspberrypi.org:80 (2a00:1098:0:82:1000:13:0:5). - connect (101: Network is unreachable) [IP: 2a00:1098:0:82:1000:13:0:5 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
========================================================================
因為公司的網路連外都需要設定 proxy, 所以還是設定一下吧.
設定 Proxy:
在 /etc/apt/apt.conf.d 下建立 "10proxy" 這個檔案, 然後修改他的內容如下,
Acquire::http::Proxy "http://id:password@yourproxyaddress:proxyport";
存檔.
有必要的話, 再設定 DNS:
打開 /etc/resolv.conf
sudo vi /etc/resolv.conf
加上
nameserver 8.8.8.8
或是貴公司的 DNS address
存檔.
reboot..........即可!!!