Unable to update WSL Ubuntu 20.04 LTS

Hi Everyone!

I’m really hoping someone has an answer to this one. I run Ubuntu 20.04 LTS in WSL on Windows 10 and went to run the updates on it. Starting with the usual “sudo apt update” command, however, netted me the following result (clipped for brevity):

Ign:1 http://security.ubuntu.com/ubuntu eoan-security InRelease
Err:2 http://security.ubuntu.com/ubuntu eoan-security Release
404  Not Found [IP: 80]
Ign:3 http://archive.ubuntu.com/ubuntu eoan InRelease
Reading package lists... Done
E: The repository 'http://security.ubuntu.com/ubuntu eoan-security Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

No lists are updated and I can’t receive any updates to any packages at all.

I’ve run into this issue in the past (both in WSL and on stand-alone installs of Linux), it usually happens after I don’t update an installation for a long time. I’ve never found a solution to it though. The only thing I’ve done to fix it is to simply blow the installation away and start fresh.

I would really like to avoid that here. Is there any other way to force Ubuntu to update the package lists when this happens? As stated the machines is Ubuntu 20.04 LTS so it can’t be out of support…right?

Thank you everyone for any insight they can provide!

That appears to be a networking issue, you may have the update servers blocked.

+1 for what @LTS_Tom said.

Over 10’s (maybe 100’s) of ubuntu installs the only time I have had apt update stop working was when I tried to update REALLY old installs, like 10+ YO installs. Sounds more like someone or something is preventing you from accessing the update servers in your area.

It could be a flaky local mirror that’s the problem. Maybe research changing your mirror?

Thanks for the replies!

I double checked everything. Tried disabling AV, I turned off pfBlockerNG on my FW, and disabled PiHole. I don’t do any outbound blocking of IPs or protocols. This is on my home network, so no fancy-ish setups. As far as I’m aware I’m not behind any mirrors or proxies. I have a fiber connection, so the public IP for my network sits right at the router.

One item of note: my stand-alone Ubuntu servers in my network updated yesterday without an issue. This leads me to believe it has to be something explicitly with this particular Ubuntu installation itself.

Is there any way to rebuild apt? Or, at least those source lists?

You can try to ping those sites to make sure you can get to them and use curl to test you can browse to them.

Some of the update servers don’t let you browse them. I’ve fallen foul of that in the past.

In fairness I’ve never used ubuntu ins WSL so it could be doing all sorts of strange stuff. The fact that your other installs are updating is good news though. Are they updating from the same repos?

Hi @garethw & @LTS_Tom,

Thanks again for the replies! Ping and communication seemed fine. I did some more searching and came across the idea of simply updating the sources.list file. I found an updated version for 20.04 LTS and switched it out for my existing one and it came right in and started working. It updated and installed updates just fine.

I’m curious though, when I compare the files I noticed that the old one was using the “eoan” directory and the new one the “focal” directory on the “archive.ubuntu.com/ubuntu” website. I know enough to know that these are most likely referring to the codenames Canonical uses for Ubuntu. My curiosity comes in how does the OS know how to swap out those codenames in the source files? Does it just happen as a result of regular “sudo apt update” checks? Or is there some other mechanism?