一般来说刚装上的ubuntu的默认源不太稳定,所以可以先修改源。
sudo vi /etc/apt/sources.list
以下为欧洲的源,挺好用的:
deb http://archive.ubuntu.com/ubuntu hardy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu hardy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu hardy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-proposed main restricted universe multiverse
在改完源之后如果update还是出现ping不到源中链接的话可以试着修改resolv.conf来配置Linux的DNS服务器:
vi /etc/resolv.conf
修改内容如下:
search localdomain
nameserver 202.96.128.86 希望修改成的DNS
nameserver 202.96.128.166 备用DNS
然后重启网络:
sudo /etc/init.d/networking restart
这样下来一般update就好使了。