好吧,这个问题我已经遇到一段时间了,我在谷歌上搜索了很多次,但都无法解决我的问题。我尝试了很多方法,包括确保我的时间设置正确,甚至尝试了不同的来源,但都不起作用。
现在,我基本上想用 apt-get 做任何事情。更新、安装,一切都非常慢,一切都挂在 [等待标题]。所以我跑了
sudo strace apt-get update
现在,这对一些镜像有效,但其他镜像脚本会挂起并循环播放这种类型的输出
select(8, [5 6 7], [], NULL, {0, 500000}) = 0 (Timeout)
gettimeofday({1303320316, 668899}, NULL) = 0
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
99% [Waiting for headers]) = 26aders]", 26
select(8, [5 6 7], [], NULL, {0, 500000}) = 0 (Timeout)
gettimeofday({1303320317, 170040}, NULL) = 0
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
99% [Waiting for headers]) = 26aders]", 26
select(8, [5 6 7], [], NULL, {0, 500000}) = 0 (Timeout)
gettimeofday({1303320317, 671178}, NULL) = 0
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
99% [Waiting for headers]) = 26aders]", 26
select(8, [5 6 7], [], NULL, {0, 500000}) = 0 (Timeout)
gettimeofday({1303320318, 172636}, NULL) = 0
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
99% [Waiting for headers]) = 26aders]", 26
任何帮助都将不胜感激。
编辑:根据要求,我在尝试运行 apt-get update 时上传了我的 tcpdump 副本。以下是链接http://pastebin.com/NvbgNxxV
编辑:这是我的 tcpdump 输出的 pcap 文件。似乎有一些文件是 apt-get 试图获取的,比如目录 ubuntu/dists/maverick-updates/main/i18n/ 中的文件。不知道 i18n 来自哪里,但我也无法通过浏览存储库来检索它们。
答案1
看起来您请求了太多不存在的文件,并且archive.ubuntu.com 会让您的单个 HTTP 会话陷入黑洞:
GET /ubuntu/dists/maverick/Release.gpg HTTP/1.1
HTTP/1.1 200 OK
GET /ubuntu/dists/maverick/main/i18n/Translation-en.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick/main/i18n/Translation-en_US.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick/multiverse/i18n/Translation-en.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick/multiverse/i18n/Translation-en_US.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick/restricted/i18n/Translation-en.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick/restricted/i18n/Translation-en_US.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick/universe/i18n/Translation-en.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick/universe/i18n/Translation-en_US.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick-security/Release.gpg HTTP/1.1
HTTP/1.1 200 OK
GET /ubuntu/dists/maverick-security/main/i18n/Translation-en.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick-security/main/i18n/Translation-en_US.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick-security/multiverse/i18n/Translation-en.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick-security/multiverse/i18n/Translation-en_US.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick-security/restricted/i18n/Translation-en.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick-security/restricted/i18n/Translation-en_US.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick-updates/Release.gpg HTTP/1.1
HTTP/1.1 200 OK
GET /ubuntu/dists/maverick-updates/main/i18n/Translation-en.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick-updates/main/i18n/Translation-en_US.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick-updates/multiverse/i18n/Translation-en.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick-updates/multiverse/i18n/Translation-en_US.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick-updates/restricted/i18n/Translation-en.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick-updates/restricted/i18n/Translation-en_US.bz2 HTTP/1.1
HTTP/1.1 404 Not Found
GET /ubuntu/dists/maverick/Release HTTP/1.1
现在我不确定为什么没有 en_US 的翻译文件,但我确实发现有人说他们在运行 apt 之前通过将 LANG 设置为 C 解决了类似的问题。试试这个:
LANG=C apt-get update