Ubuntu 执行apt-get install时,必须先配置dns.

更新时的注意事项:
错误 http://cn.archive.ubuntu.com/ubuntu/ maverick-updates/main xbase-clients all 1:7.5+6ubuntu3.1
  解析“cn.archive.ubuntu.com:http”时,出现了某些故障(-5 - No address associated with hostname)
错误 http://cn.archive.ubuntu.com/ubuntu/ maverick/universe vnc4server amd64 4.1.1+xorg4.3.0-37ubuntu2
  解析“cn.archive.ubuntu.com:http”时,出现了某些故障(-5 - No address associated with hostname)
错误 http://cn.archive.ubuntu.com/ubuntu/ maverick/universe xrdp amd64 0.5.0~20100303cvs-4
  解析“cn.archive.ubuntu.com:http”时,出现了某些故障(-5 - No address associated with hostname)
错误 http://security.ubuntu.com/ubuntu/ maverick-security/main xbase-clients all 1:7.5+6ubuntu3.1
  解析“security.ubuntu.com:http”时,出现了某些故障(-5 - No address associated with hostname)
无法下载 http://security.ubuntu.com/ubuntu/pool/main/x/xorg/xbase-clients_7.5+6ubuntu3.1_all.deb  解析“security.ubuntu.com:http”时,出现了某些故障(-5 - No address associated with hostname)
无法下载 http://cn.archive.ubuntu.com/ubuntu/pool/universe/v/vnc4/vnc4server_4.1.1+xorg4.3.0-37ubuntu2_amd64.deb  解析“cn.archive.ubuntu.com:http”时,出现了某些故障(-5 - No address associated with hostname)
无法下载 http://cn.archive.ubuntu.com/ubuntu/pool/universe/x/xrdp/xrdp_0.5.0~20100303cvs-4_amd64.deb  解析“cn.archive.ubuntu.com:http”时,出现了某些故障(-5 - No address associated with hostname)
E: 有几个软件包无法下载,您可以运行 apt-get update 或者加上 --fix-missing 的选项再试试?


后来发现 ping www.baidu.com都ping不通,才知道没有配置dns。于是:
echo 'nameserver 192.168.0.1' >> /etc/resolv.conf
echo 'nameserver 88.8.8.8' >> /etc/resolv.conf

//然后重启网卡
/etc/init.d/networking restart

再次执行,ok了。

猜你喜欢

转载自keren.iteye.com/blog/1528500