0

I'm running windows 10 with WSL2. I installed a distribution of Ubuntu 20.04.

When I do sudo apt update, it's working

Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Fetched 328 kB in 17s (19.3 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

Then I tried adding a repository for podman. In /etc/apt/sources.list

deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /

But now when doing sudo apt update I got

Err:1 https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04  InRelease
  Temporary failure resolving 'download.opensuse.org'
Err:2 http://archive.ubuntu.com/ubuntu focal InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://security.ubuntu.com/ubuntu focal-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Fetched 214 kB in 34s (6269 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/InRelease  Temporary failure resolving 'download.opensuse.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

Yet a ping is working

PING download.opensuse.org (195.135.221.134) 56(84) bytes of data.
64 bytes from download.opensuse.org (195.135.221.134): icmp_seq=1 ttl=58 time=36.9 ms
64 bytes from download.opensuse.org (195.135.221.134): icmp_seq=2 ttl=58 time=35.9 ms

Removing the repository line and it is working.

What would be the problem ?

Edit

I asked other coworkers to try the same and it's working for them. So I suppose it is not a proxy or dns problem on the network. The last 'guilty' :-) seems to be my laptop. But why ?

karel
  • 110,292
  • 102
  • 269
  • 299
tweetysat
  • 391
  • 2
  • 8
  • 24
  • It's working fine here (Ubuntu server 20.04). Maybe check your internet connection? – Liso Nov 18 '21 at 08:53
  • My internet connection is ok. See get 4 and get 5 working. And a ping is working. – tweetysat Nov 18 '21 at 09:11
  • Are you connecting behind a proxy? – ChanganAuto Nov 18 '21 at 14:57
  • Yes. I'm behind a corporate proxy. So I can consider a resolving problem with download.opensuse.org but not with the other ones when adding opensuse. See also my edited question. – tweetysat Nov 19 '21 at 07:57
  • I had the same issue, closed it and run ubuntu again as admin. Worked for me then. – user1582298 Mar 27 '22 at 16:20
  • Does this answer your question? [apt-get update fails to fetch files, “Temporary failure resolving …” error](https://askubuntu.com/questions/91543/apt-get-update-fails-to-fetch-files-temporary-failure-resolving-error) – karel Mar 23 '23 at 06:13

1 Answers1

0

This worked for me: The solutions found online helped me fix the issue in my home network, but DNS resolution would still not work when using my laptop at the office. This is what seemed to work:

In WSL, set up two distributions, e.g. "Ubuntu" and "Debian"

  1. Set one to WSL version 1, and the other to WSL version 2
  2. wsl --set-version Ubuntu 1
  3. wsl --set-version Debian 2
  4. Copy the contents of /etc/resolv.conf in Ubuntu (WSL 1) to Debian (WSL 2)

Done Just converting wsl 2 back to wsl 1 provides the information needed to update /etc/resolv.conf. copy the content, convert back to wsl 2 and past the info in the /etc/resolv.conf.

It turned out that /etc/resolv.conf in WSL 1 had a special entry "search our-company-domain.de" (and some ipv4 and ipv6 addresses). One of the ips is the address of our central server. I guess I will also have to turn of the automatic generation of resolv.conf.

see: https://gist.github.com/sivinnguyen/8bc0125b274250683a97e149cf270040?permalink_comment_id=3974132#gistcomment-3974132

pommeken
  • 1
  • 1