首页 > 解决方案 > 无法更新 WSL 分发包

问题描述

我正在使用 Docker desktop v2.3.0,并在 Windows 10 Professional v1909 上启用了 WSL2。

我安装了 Ubuntu 20.04 发行版,我访问了它,当我运行时apt-get update

Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://security.ubuntu.com/ubuntu focal-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/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: Some index files failed to download. They have been ignored, or old ones used instead.

我尝试/etc/resolve.conf通过在使用后添加公司 dns 服务器来更新ipconfig /all.

然后我重新启动了 WSL 但不起作用。

我在 WSL Ubuntu(Linux 的 Windows 子系统)上发现了一个类似的问题No internet connection并尝试了这个解决方案,但他们都没有为我解决这个问题。

我使用代理访问互联网,是否可以禁止 WSL 访问外部网络并应将其添加到 wsl 配置文件中?

标签: linuxdockerubuntuwindows-subsystem-for-linux

解决方案


推荐阅读