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

来源:互联网 发布:java web 反编译 编辑:程序博客网 时间:2024/06/05 16:38

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.comping: 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.confnameserver <DNS server ip>

然后重启网络配置。

/etc/init.d/networking restart

再次运行apt-get安装就成功了。


0 0