Ubuntu apt-get install 问题: Could not resolve 'cn.archive.ubuntu.com'
2014-12-09 21:50
603 查看
问题描述:
今天使用Ubuntu 安装Ctags 时,遇见以下问题:sudo apt-get install ctags
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'exuberant-ctags' instead of 'ctags'
The following NEW packages will be installed:
exuberant-ctags
0 upgraded, 1 newly installed, 0 to remove and 356 not upgraded.
Need to get 133 kB of archives.
After this operation, 308 kB of additional disk space will be used.
Err http://cn.archive.ubuntu.com/ubuntu/ saucy/main exuberant-ctags i386 1:5.9~svn20110310-6
Could not resolve 'cn.archive.ubuntu.com'
Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/e/exuberant-ctags/exuberant-ctags_5.9~svn20110310-6_i386.deb Could not resolve 'cn.archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
解决方法:
从Error Message 上看来似乎是“cn.archive.ubuntu.com”域名解析出错。于是在Terminal 里Ping了一下这个域名,发现可以Ping 通。ping cn.archive.ubuntu.com
PING mirror.neu.edu.cn (202.118.1.64) 56(84) bytes of data.
64 bytes from ftp2.neu.edu.cn (202.118.1.64): icmp_seq=1 ttl=45 time=86.3 ms
64 bytes from ftp2.neu.edu.cn (202.118.1.64): icmp_seq=2 ttl=45 time=100 ms
64 bytes from ftp2.neu.edu.cn (202.118.1.64): icmp_seq=3 ttl=45 time=86.8 ms
于是尝试通过修改 /etc/hosts 解决这个问题:
vi /etc/hosts
在文件末尾加入 “202.118.1.64 cn.archive.ubuntu.com”。
运行 “#/etc/init.d/networking restart” 重启网络。
运行 “sudo apt-get install ctags” 重新安装Ctags,成功!!!
相关文章推荐
- Ubuntu apt-get install 问题: Could not resolve 'cn.archive.ubuntu.com'
- Ubuntu下的Ubuntu虚拟机--源配置问题:apt-get update 显示could not resolve 'mirrors.163.com'
- apt-get: Could not resolve 'archive.ubuntu.com'
- Ubuntu使用apt-get install下载安装一些软件包的时候连接不到cn.archive.ubuntu.com
- apt-get: Could not resolve 'archive.ubuntu.com'解决方法
- apt-get: Could not resolve 'archive.ubuntu.com'
- apt-get: Could not resolve 'archive.ubuntu.com'
- ubuntu图下安装软件出现You might want to run 'apt-get -f install' to correct these解决
- ubuntu下安装软件出现You might want to run 'apt-get -f install' to correct these解决
- apt-get update --> Bad header line (fresh install) Ign http://archive.ubuntu.com natty-security/multiverse Sources/DiffIndex W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/natty/Rele
- ubuntu图下安装软件出现You might want to run 'apt-get -f install' to correct these解决
- ubuntu图下安装软件出现You might want to run 'apt-get -f install' to correct these解决
- ubuntu的安装软件问题:E:Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavaila
- 解决 “Could not find class 'com.goole.zxing.Result”和“Multiple dex files define”问题
- ubuntu常见错误--Could not get lock /var/lib/dpkg/lock解决 通过终端安装程序sudo apt-get install xxx时出错: E: Coul
- ubuntu 出现 You might want to run `apt-get --fix-broken install' to correct these:
- ubuntu图下安装软件出现You might want to run 'apt-get -f install' to correct these解决
- 在Ubuntu中,有时候运用sudo apt-get install 安装软件时,会出现一下的情况 E: Could not get lock /var/lib/dpkg/lock - open
- Ubuntu上出现无法获得锁“Could not get lock /var/lib/apt/lists/lock”问题的解决
- Ubuntu使用apt-get install 安装软件时报错:could not get lock /var/lib/dpkg/lock -open