apt update 总是以错误结束:已达到超时

apt update 总是以错误结束:已达到超时

我在 WSL2 上运行 Ubuntu 22.04 LTS,遇到了某种 apt 问题,在网络连接正常且 nslookups 确认的情况下,我总是生成幻影Error: Timeout Was Reached。我说幻影是因为我检查了所有可能的日志,但找不到任何提示相关错误或连接错误的内容。我检查过的日志,

  • 日志控制
  • apt 术语和历史记录
  • 系统日志
  • 消息

我也尝试了每个 apt clean、remove、autoremove 命令。

我尝试以更详细的模式运行更新,但仍然没有指示为什么apt update尽管能够找到其他请求的包,但总是以超时结束。我尝试使用 22.04 的 vanilla sources.list 编辑 sources.list,但仍然超时。我尝试一次启用一个源,但无论提取是否成功,它们最终都会超时。

我完全不知道是什么原因造成的,如果有更多日志可以分享,请告诉我。

以下是 输出的一个示例sudo apt update

Hit:1 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://archive.canonical.com/ubuntu jammy InRelease
Hit:5 https://ppa.launchpadcontent.net/rael-gc/rvm/ubuntu jammy InRelease
Error: Timeout was reached
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.

下面是我从 收到的输出结束的一个例子sudo apt -oDebug::pkgAcquire::Worker=1 update

0% [Waiting for headers] <- http:102%20Status%0aMessage:%20Waiting%20for%20headers%0aURI:%20http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease
 <- gpgv:201%20URI%20Done%0aGPGVOutput:%20GOODSIG%20871920D1991BC93C%0aSigned-By:%20F6ECB3762474EDA9D21B7022871920D1991BC93C!%0aFilename:%20/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_jammy_InRelease%0aURI:%20gpgv:/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_jammy_InRelease
 -> gpgv:600%20URI%20Acquire%0aURI:%20gpgv:/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-security_InRelease%0aFilename:%20/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-security_InRelease%0aTarget-Type:%20index%0aTarget-Release:%20jammy-security%0aTarget-Repo-URI:%20http://archive.ubuntu.com/ubuntu/%0aTarget-Base-URI:%20http://archive.ubuntu.com/ubuntu/dists/jammy-security/%0aTarget-Site:%20http://archive.ubuntu.com/ubuntu%0aIndex-File:%20true%0aMaximum-Size:%2010000000%0aLast-Modified:%20Tue,%2030%20Jan%202024%2006:38:28%20GMT%0aFail-Ignore:%20true%0a%0a
0% [Waiting for headers] [Waiting for headers] <- gpgv:201%20URI%20Done%0aGPGVOutput:%20GOODSIG%20871920D1991BC93C%0aSigned-By:%20F6ECB3762474EDA9D21B7022871920D1991BC93C!%0aFilename:%20/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-security_InRelease%0aURI:%20gpgv:/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-security_InRelease
0% [Waiting for headers] [Waiting for headers] <- http:201%20URI%20Done%0aIMS-Hit:%20true%0aLast-Modified:%20Fri,%2019%20Jan%202024%2017:47:17%20+0000%0aFilename:%20/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_jammy-backports_InRelease%0aURI:%20http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease
 -> gpgv:600%20URI%20Acquire%0aURI:%20gpgv:/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-backports_InRelease%0aFilename:%20/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-backports_InRelease%0aTarget-Type:%20index%0aTarget-Release:%20jammy-backports%0aTarget-Repo-URI:%20http://archive.ubuntu.com/ubuntu/%0aTarget-Base-URI:%20http://archive.ubuntu.com/ubuntu/dists/jammy-backports/%0aTarget-Site:%20http://archive.ubuntu.com/ubuntu%0aIndex-File:%20true%0aMaximum-Size:%2010000000%0aLast-Modified:%20Fri,%2019%20Jan%202024%2017:47:17%20GMT%0aFail-Ignore:%20true%0a%0a
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
0% [Waiting for headers] <- gpgv:201%20URI%20Done%0aGPGVOutput:%20GOODSIG%20871920D1991BC93C%0aSigned-By:%20F6ECB3762474EDA9D21B7022871920D1991BC93C!%0aFilename:%20/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-backports_InRelease%0aURI:%20gpgv:/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-backports_InRelease
0% [Waiting for headers] <- https:201%20URI%20Done%0aIMS-Hit:%20true%0aLast-Modified:%20Mon,%2023%20May%202022%2016:49:11%20+0000%0aFilename:%20/var/lib/apt/lists/partial/ppa.launchpadcontent.net_rael-gc_rvm_ubuntu_dists_jammy_InRelease%0aURI:%20https://ppa.launchpadcontent.net/rael-gc/rvm/ubuntu/dists/jammy/InRelease
 -> gpgv:600%20URI%20Acquire%0aURI:%20gpgv:/var/lib/apt/lists/ppa.launchpadcontent.net_rael-gc_rvm_ubuntu_dists_jammy_InRelease%0aFilename:%20/var/lib/apt/lists/ppa.launchpadcontent.net_rael-gc_rvm_ubuntu_dists_jammy_InRelease%0aTarget-Type:%20index%0aTarget-Release:%20jammy%0aTarget-Repo-URI:%20https://ppa.launchpadcontent.net/rael-gc/rvm/ubuntu/%0aTarget-Base-URI:%20https://ppa.launchpadcontent.net/rael-gc/rvm/ubuntu/dists/jammy/%0aTarget-Site:%20https://ppa.launchpadcontent.net/rael-gc/rvm/ubuntu%0aIndex-File:%20true%0aMaximum-Size:%2010000000%0aLast-Modified:%20Mon,%2023%20May%202022%2016:49:11%20GMT%0aFail-Ignore:%20true%0a%0a
Hit:5 https://ppa.launchpadcontent.net/rael-gc/rvm/ubuntu jammy InRelease
0% [Working] <- gpgv:201%20URI%20Done%0aGPGVOutput:%20GOODSIG%208094BB14F4E3FBBE%0aSigned-By:%207BE3E5681146FD4F1A40EDA28094BB14F4E3FBBE!%0aFilename:%20/var/lib/apt/lists/ppa.launchpadcontent.net_rael-gc_rvm_ubuntu_dists_jammy_InRelease%0aURI:%20gpgv:/var/lib/apt/lists/ppa.launchpadcontent.net_rael-gc_rvm_ubuntu_dists_jammy_InReleaseError: Timeout was reached
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them

更新:重置 sources.list 以仅使用 archive.ubuntu.com

来源列表:

deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse

# deb http://archive.canonical.com/ubuntu/ jammy partner
# deb-src http://archive.canonical.com/ubuntu/ jammy partner

结果:

Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Error: Timeout was reached
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.

如果没有证据,如果我不得不猜测,我会说这一切都始于几周前一次拙劣的 mysql 卸载,不确定这是否提供了任何有用的信息。

相关内容