您的位置:首页 > 其它

ubuntu12.04升级到14.04,apt-get install失败的问题解决

2015-06-12 18:27 621 查看
Ubuntu升级之后打算安装几个新的软件:

sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal


返回错误类似如下:

E: Failed to fetch http://hk.archive.ubuntu.com/ubuntu/pool/universe/x/xfce4-appfinder/xfce4-appfinder_4.10.1-1_amd64.deb  Could not resolve 'hk.archive.ubuntu.com'

E: Failed to fetch http://hk.archive.ubuntu.com/ubuntu/pool/universe/x/xfce4-mixer/xfce4-mixer_4.10.0-1ubuntu2_amd64.deb  Could not resolve 'hk.archive.ubuntu.com'


这个是网络解析过程出错导致的。ping内网机器可以,但是外网机器ping不通。

irdetogame@CMGC-5:~$ ping cn.archive.ubuntu.com
ping: unknown host cn.archive.ubuntu.com


然后尝试设置默认网关。

irdetogame@CMGC-5:/etc$ sudo route add default gw 192.168.1.1
[sudo] password for irdetogame:
SIOCADDRT: Network is unreachable


提示 network is unreachable。原来服务器升级之后,DNS配置不见了,于是重新配置DNS。

vi /etc/resolv.conf

nameserver <DNS server ip>


然后重启网络配置。

/etc/init.d/networking restart


再次运行apt-get安装就成功了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: