我正在用WSL2运行windows 10。我安装了一个Ubuntu20.04发行版。
当我做sudo apt update
的时候,它起作用了
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.
然后我尝试为podman添加一个存储库。在/etc/apt/sources.list
中
deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /
但是现在当我做适当的更新的时候
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.
但是ping正在起作用。
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
移除存储库行,它就可以工作了。
会有什么问题?
编辑
我让其他同事试着做同样的事,这对他们很有帮助。所以我想这不是网络上的代理或dns问题。最后一个‘有罪’:-)似乎是我的笔记本电脑。但为什么?
发布于 2022-04-05 13:01:11
这对我起了作用:网上找到的解决方案帮助我解决了家庭网络中的问题,但当我在办公室使用笔记本电脑时,DNS解析仍然不能工作。这似乎是起作用的:
在WSL中,设置两个发行版。"Ubuntu“和"Debian”
只需将wsl 2转换回wsl 1即可提供更新/etc/解析式. Done所需的信息。复制内容,转换回wsl 2,并通过/etc/ copy中的信息。
结果发现,WSL 1中的/etc/rupv.conf有一个特殊条目“搜索我们的公司-domain.de”(以及一些ipv4和ipv6地址)。其中一个ips是我们中央服务器的地址。我想我也将不得不转向resolv.conf的自动生成。
https://askubuntu.com/questions/1376255
复制相似问题