1

I'm running Ubuntu 22.04 LTS on WSL2 and have been running into some kind of apt issue where with a working internet connection and confirmed nslookups I always generate a phantom Error: Timeout Was Reached. I say phantom because I've checked every conceivable log and cannot find anything hinting at what error or connection errors would be relevant. Logs I've checked,

  • journalctl
  • apt term and history logs
  • syslog
  • dmesg

I've also tried every apt clean, remove, autoremove command.

I've tried running update in a more verbose mode but there is still no indicator why apt update always finishes with a timeout despite being able to find other requested packages. I've tried editing sources.list with the vanilla sources.list for 22.04 and still timeout. I've tried enabling a single source at a time but they all hit a timeout at the end regardless of successful fetches.

I am at a complete loss what is causing this, please let me know if there's further logs I can share.

Here is an example of the output of 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.

Here is an example of that end of output I receive from 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

UPDATE: Reset sources.list to just use archive.ubuntu.com

sources.list:

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

result:

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.

Without evidence, if I had to guess, I'd say this all started with a botched a mysql uninstall a few weeks ago, not sure if that provides any helpful context.

2 Answers2

1

I finally fixed this, it was a bad symlink to a nonexistent directory in my host OS via /etc/fstab.

0

Here are some maybe-useful tips. I ran into this with just apt-update for ubuntu 20.04 on a spare usb rescue thumb drive.

https://superuser.com/questions/528518/apt-get-install-error-timeout-was-reached

https://web.archive.org/web/20240520172445/https://fanf42.blogspot.com/2014/08/upgrading-to-ubuntu-1404-error-timeout.html

in my case, (re-)installing the current version of libapt resolved the issue (per the blogspot post) dpkg --list | grep libapt apt install libapt-pkg6.0

Hope you resolved it.

BISI
  • 792