Я использую сервер 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, но я могу без проблем пинговать «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
Есть идеи по проблеме или как ее исправить?
Похоже, это может быть проблема с прокси. Установлена ли у вас переменная env HTTP_PROXY или есть ли у вас какие-либо настройки «прокси» в файлах / etc / apt / * (проверьте /etc/apt/apt.conf.d/)?
Попробуйте изменить URL-адрес на http://us.archive.ubuntu.com в /etc/apt/sources.list. Отсюда в Южной Африке http://archive.ubuntu.com разрешается на другой сервер, отличный от того, который вам нужен. Но http://us.archive.ubuntu.com разрешается до 91.189.88.46.
Использование другого DNS-сервера в /etc/resolv.conf также может решить проблему.
Каков результат следующих команд?
dig archive.ubuntu.com
curl 'http://archive.ubuntu.com/'
cat /etc/resolv.conf
Кроме того, отличается ли результат от выполнения этих команд от имени пользователя root? (Т.е. sudo dig archive.ubuntu.com
?
Это маловероятно, но могут возникнуть проблемы с MTU.
Вы можете проверить это двумя способами:
Метод 1 - изменение размера MTU:
sudo ifconfig eth0 mtu 1492
sudo apt-get update
Продолжайте снижать с шагом 500, пока не дойдете до смехотворно малых размеров MTU.
sudo ifconfig eth0 mtu 600
sudo apt-get update
Метод 2 - проверьте проблему MTU, пытаясь отправить эхо-запросы различного размера
ping -s 1400 archive.ubuntu.com
Если что-то из этого сработает, я рекомендую вам продолжать тестирование, пока вы не найдете максимальный размер 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)
Я не могу ничего "свернуть", потому что он не установлен (и я не могу его установить, потому что apt-get не работает: - /) На данный момент я смотрю на то, чтобы просто переустановить эту ОС, мы ищем при переходе на OpenSolaris в любом случае.