我正在运行Ubuntu服务器(x86),最近我注意到“sudo apt-get *”停止工作。 例如,如果我尝试运行“sudo apt-get update”,它将返回:
Err http://archive.ubuntu.com intrepid Release.gpg Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid/main Translation-en_US Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid/restricted Translation-en_US Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid/universe Translation-en_US Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid/multiverse Translation-en_US Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid-updates Release.gpg Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid-updates/main Translation-en_US Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid-updates/restricted Translation-en_US Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid-updates/universe Translation-en_US Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid-updates/multiverse Translation-en_US Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid-security Release.gpg Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid-security/main Translation-en_US Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid-security/restricted Translation-en_US Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid-security/universe Translation-en_US Could not resolve 'archive.ubuntu.com' Err http://archive.ubuntu.com intrepid-security/multiverse Translation-en_US Could not resolve 'archive.ubuntu.com' Reading package lists... Done W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid/Release.gpg Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid/main/i18n/Translation-en_US.bz2 Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid/restricted/i18n/Translation-en_US.bz2 Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid/universe/i18n/Translation-en_US.bz2 Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid/multiverse/i18n/Translation-en_US.bz2 Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid-updates/Release.gpg Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid-updates/main/i18n/Translation-en_US.bz2 Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid-updates/restricted/i18n/Translation-en_US.bz2 Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid-updates/universe/i18n/Translation-en_US.bz2 Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid-updates/multiverse/i18n/Translation-en_US.bz2 Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid-security/Release.gpg Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid-security/main/i18n/Translation-en_US.bz2 Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid-security/restricted/i18n/Translation-en_US.bz2 Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid-security/universe/i18n/Translation-en_US.bz2 Could not resolve 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/intrepid-security/multiverse/i18n/Translation-en_US.bz2 Could not resolve 'archive.ubuntu.com' W: Some index files failed to download, they have been ignored, or old ones used instead. W: You may want to run apt-get update to correct these problems
起初,它似乎是一个DNS问题,但我可以ping“archive.ubuntu.com”没有任何问题。
PING archive.ubuntu.com (91.189.88.46) 56(84) bytes of data. 64 bytes from lithium.canonical.com (91.189.88.46): icmp_seq=1 ttl=45 time=123 ms 64 bytes from lithium.canonical.com (91.189.88.46): icmp_seq=2 ttl=45 time=124 ms 64 bytes from lithium.canonical.com (91.189.88.46): icmp_seq=3 ttl=45 time=158 ms
任何想法的问题或如何解决它?
这听起来可能是一个代理问题。 你有HTTP_PROXY的envvariables集,或者你有/ etc / apt / *文件中的任何“代理”设置(检查在/etc/apt/apt.conf.d/)?
以下命令的输出是什么?
dig archive.ubuntu.com
curl 'http://archive.ubuntu.com/'
cat /etc/resolv.conf
另外,运行这些命令的结果是不是以root身份运行它们? (即, sudo dig archive.ubuntu.com ?
尝试在/etc/apt/sources.list中将URL更改为http://us.archive.ubuntu.com 。 从这里南非http://archive.ubuntu.com解决到一个不同的服务器,你需要使用。 但http://us.archive.ubuntu.com确实parsing为91.189.88.46。
在/etc/resolv.conf中使用不同的DNS服务器也可以解决这个问题。
这是不太可能的,但你可能有MTU问题。
你可以testing这两种方式:
方法1 – 更改您的MTU大小:
sudo ifconfig eth0 mtu 1492 sudo apt-get update
继续以500个增量降低,直到你降低到可笑的小MTU大小。
sudo ifconfig eth0 mtu 600 sudo apt-get update
方法2 – 通过尝试发送不同大小的ping来testingMTU问题
ping -s 1400 archive.ubuntu.com
如果其中任何一项工作,我build议你继续testing,直到你find适合你的最大MTU大小。 有一个随机的服务器和其他人一起工作会遇到这个问题是很奇怪的,但是已经知道发生了一些陌生的事情。
挖掘返回:
; <<>> DiG 9.4.2 <<>> archive.ubuntu.com ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19419 ;; flags: qr rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;archive.ubuntu.com. IN A ;; ANSWER SECTION: archive.ubuntu.com. 532 IN A 91.189.88.30 archive.ubuntu.com. 532 IN A 91.189.88.134 archive.ubuntu.com. 532 IN A 91.189.88.135 archive.ubuntu.com. 532 IN A 91.189.88.31 archive.ubuntu.com. 532 IN A 91.189.88.40 archive.ubuntu.com. 532 IN A 91.189.88.46 archive.ubuntu.com. 532 IN A 91.189.88.45 ;; Query time: 71 msec ;; SERVER: 192.168.0.1#53(192.168.0.1) ;; WHEN: Wed Nov 4 16:19:27 2009 ;; MSG SIZE rcvd: 148
/etc/resolv.conf包含: nameserver 129.168.0.1
使用ifconfig:
eth0 Link encap:Ethernet HWaddr 00:14:6c:76:69:89 inet addr:192.168.0.197 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::214:6cff:fe76:6989/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:19964625 errors:0 dropped:789 overruns:0 frame:0 TX packets:11729444 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2505013589 (2.3 GB) TX bytes:446515595 (425.8 MB) Interrupt:16 Base address:0xcc00 ham0 Link encap:Ethernet HWaddr 00:ff:cb:59:46:25 inet addr:5.217.20.154 Bcast:5.255.255.255 Mask:255.0.0.0 UP BROADCAST RUNNING MULTICAST MTU:1200 Metric:1 RX packets:436 errors:0 dropped:0 overruns:0 frame:0 TX packets:1412 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:500 RX bytes:92667 (90.4 KB) TX bytes:355745 (347.4 KB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:1290 errors:0 dropped:0 overruns:0 frame:0 TX packets:1290 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:69088 (67.4 KB) TX bytes:69088 (67.4 KB)
我不能“curl”任何东西,因为它没有安装(&我不能安装它,因为apt-get不工作: – /)在这一点上,我正在寻找重新安装该操作系统,我们正在寻找无论如何转向OpenSolaris。