Errors when updating Ubuntu 24.04 on WSL2 (Windows 10)

Ubuntu Support Template

Ubuntu Version:
Example: 24.04

Desktop Environment (if applicable):

WSL2

Problem Description:
I am have a WSL2 installation of Ubuntu 24.04 that I am trying to update with

sudo apt update

But I receives errors that say it cannot resolve the urls.

Relevant System Information:
Windows 10, no pending updates

Screenshots or Error Messages:

tstewart@DESKTOP-TFRJ1CN:~/interlisp/medley$ sudo apt update
[sudo] password for tstewart:
Ign:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu noble InRelease
Ign:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Ign:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Ign:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Ign:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Ign:2 http://archive.ubuntu.com/ubuntu noble InRelease
Err:1 http://security.ubuntu.com/ubuntu noble-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Ign:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Ign:2 http://archive.ubuntu.com/ubuntu noble InRelease
Ign:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Ign:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Err:2 http://archive.ubuntu.com/ubuntu noble InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
49 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/noble/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/noble-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/noble-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/noble-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

What I’ve Tried:
I thought there might be a network problem. So I tried to ping archive.ubuntu.com in both Windows and Ubuntu. In both cases I was able to ping. This is the output from Ubuntu.

tstewart@DESKTOP-TFRJ1CN:~/interlisp/medley$ ping -c 4 archive.ubuntu.com
PING archive.ubuntu.com (91.189.92.22) 56(84) bytes of data.
64 bytes from ubuntu-archive-mirror-1.ps7.canonical.com (91.189.92.22): icmp_seq=1 ttl=50 time=119 ms
64 bytes from ubuntu-archive-mirror-1.ps7.canonical.com (91.189.92.22): icmp_seq=2 ttl=50 time=118 ms
64 bytes from ubuntu-archive-mirror-1.ps7.canonical.com (91.189.92.22): icmp_seq=3 ttl=50 time=117 ms
64 bytes from ubuntu-archive-mirror-1.ps7.canonical.com (91.189.92.22): icmp_seq=4 ttl=50 time=117 ms

--- archive.ubuntu.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2998ms

I also tried curl to see what was returned.

tstewart@DESKTOP-TFRJ1CN:~$ curl http://archive.ubuntu.com/ubuntu/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
 <head>
  <title>Index of /ubuntu</title>
 </head>
 <body>
<h1>Index of /ubuntu</h1>
  <table>
   <tr><th valign="top"><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th></tr>
   <tr><th colspan="4"><hr></th></tr>
<tr><td valign="top"><img src="/icons/back.gif" alt="[PARENTDIR]"></td><td><a href="/">Parent Directory</a></td><td>&nbsp;</td><td align="right">  - </td></tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[   ]"></td><td><a href="Archive-Update-in-Progress-ubuntu-prod-archive-servers-2">Archive-Update-in-Progress-ubuntu-prod-archive-servers-2</a></td><td align="right">2026-02-02 11:48  </td><td align="right">  1 </td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="dists/">dists/</a></td><td align="right">2025-10-09 16:00  </td><td align="right">  - </td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="indices/">indices/</a></td><td align="right">2026-02-02 11:34  </td><td align="right">  - </td></tr>
<tr><td valign="top"><img src="/icons/compressed.gif" alt="[   ]"></td><td><a href="ls-lR.gz">ls-lR.gz</a></td><td align="right">2026-02-02 11:39  </td><td align="right"> 34M</td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="pool/">pool/</a></td><td align="right">2010-02-27 06:30  </td><td align="right">  - </td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="project/">project/</a></td><td align="right">2024-11-24 21:31  </td><td align="right">  - </td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="ubuntu/">ubuntu/</a></td><td align="right">2026-02-02 11:48  </td><td align="right">  - </td></tr>
   <tr><th colspan="4"><hr></th></tr>
</table>
<address>Apache/2.4.52 (Ubuntu) Server at archive.ubuntu.com Port 80</address>
</body></html>
tstewart@DESKTOP-TFRJ1CN:~$ curl http://archive.ubuntu.com/ubuntu/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
 <head>
  <title>Index of /ubuntu</title>
 </head>
 <body>
<h1>Index of /ubuntu</h1>
  <table>
   <tr><th valign="top"><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th></tr>
   <tr><th colspan="4"><hr></th></tr>
<tr><td valign="top"><img src="/icons/back.gif" alt="[PARENTDIR]"></td><td><a href="/">Parent Directory</a></td><td>&nbsp;</td><td align="right">  - </td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="dists/">dists/</a></td><td align="right">2025-10-09 16:00  </td><td align="right">  - </td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="indices/">indices/</a></td><td align="right">2026-02-02 11:34  </td><td align="right">  - </td></tr>
<tr><td valign="top"><img src="/icons/compressed.gif" alt="[   ]"></td><td><a href="ls-lR.gz">ls-lR.gz</a></td><td align="right">2026-02-02 11:39  </td><td align="right"> 34M</td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="pool/">pool/</a></td><td align="right">2010-02-27 06:30  </td><td align="right">  - </td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="project/">project/</a></td><td align="right">2024-11-24 21:31  </td><td align="right">  - </td></tr>
<tr><td valign="top"><img src="/icons/folder.gif" alt="[DIR]"></td><td><a href="ubuntu/">ubuntu/</a></td><td align="right">2026-02-02 11:56  </td><td align="right">  - </td></tr>
   <tr><th colspan="4"><hr></th></tr>
</table>
<address>Apache/2.4.58 (Ubuntu) Server at archive.ubuntu.com Port 80</address>
</body></html>

Before Posting:
I found this similar question, but they were just asked to try to ping it and I did that. And there was no resolution.

Hi and welcome to the community! :waving_hand:

Since ping and curl are working, this looks like a DNS issue inside WSL rather than a general network problem.

Before we continue, could you confirm:

  • Are you using any antivirus or third-party firewall on Windows?
  • Are you connected through a VPN or corporate network?

Also, please run this inside Ubuntu and share the output:

cat /etc/resolv.conf

We want to check whether a valid nameserver is configured.

Looking forward to your reply!

2 Likes

Alright, to answer your first two questions.

  • Are you using any antivirus or third-party firewall on Windows?
    • Only the default Windows Security, and no third-party firewall on Windows.
  • Are you connected through a VPN or corporate network?
    • I do use a VPN, but it was not operating at the time.

That file contains:

tstewart@DESKTOP-TFRJ1CN:~$ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.26.32.1

I have no explanation for this because the only thing that has changed since I wrote my initial question was that I checked resolv.conf and answered your questions, but I decided to try it again and sudo apt update/upgrade worked properly this time. I didn’t even touch the computer between these.

It was just a temporary network failure.

1 Like

Glad to hear it’s working now! :blush:

I was actually about to suggest the classic “have you tried restarting it?” approach — but I felt that might be a bit too obvious to say out loud :grinning_face_with_smiling_eyes:

Sometimes WSL networking just needs a reset, especially with VPNs or network changes involved. A simple:

wsl --shutdown

followed by reopening Ubuntu can magically fix these temporary DNS hiccups.

In any case, I’m glad it resolved itself — and thanks for following up with the result!

1 Like

To give myself a little bit of credit, I did try restarting it before I wrote the initial question, I guess it seemed so obvious that I forgot to mention it as a step I took. Did that a few times, to no success. I’ve been using WSL for a few years now and this is the first really annoying hiccup I’ve had since WSL2 came out. Well, hopefully it will not return any time soon.

This topic was automatically closed after 30 days. New replies are no longer allowed.