首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Windows 10 WSL2 - Ubuntu - apt临时故障解决更新

Windows 10 WSL2 - Ubuntu - apt临时故障解决更新
EN

Ask Ubuntu用户
提问于 2021-11-18 06:52:03
回答 1查看 5.7K关注 0票数 0

我正在用WSL2运行windows 10。我安装了一个Ubuntu20.04发行版。

当我做sudo apt update的时候,它起作用了

代码语言:javascript
运行
复制
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

代码语言:javascript
运行
复制
deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /

但是现在当我做适当的更新的时候

代码语言:javascript
运行
复制
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正在起作用。

代码语言:javascript
运行
复制
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问题。最后一个‘有罪’:-)似乎是我的笔记本电脑。但为什么?

EN

回答 1

Ask Ubuntu用户

发布于 2022-04-05 13:01:11

这对我起了作用:网上找到的解决方案帮助我解决了家庭网络中的问题,但当我在办公室使用笔记本电脑时,DNS解析仍然不能工作。这似乎是起作用的:

在WSL中,设置两个发行版。"Ubuntu“和"Debian”

  1. 将一个设置为WSL版本1,另一个设置为WSL版本2。
  2. wsl --集-版本Ubuntu 1
  3. wsl --集- Debian 2版本
  4. 将Ubuntu (WSL 1)中/etc/rupv.conf的内容复制到Debian (WSL 2)

只需将wsl 2转换回wsl 1即可提供更新/etc/解析式. Done所需的信息。复制内容,转换回wsl 2,并通过/etc/ copy中的信息。

结果发现,WSL 1中的/etc/rupv.conf有一个特殊条目“搜索我们的公司-domain.de”(以及一些ipv4和ipv6地址)。其中一个ips是我们中央服务器的地址。我想我也将不得不转向resolv.conf的自动生成。

请参阅:https://gist.github.com/sivinnguyen/8bc0125b274250683a97e149cf270040?permalink_评论_id=3974132#gistcom-3974132

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1376255

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档