linux - 无法更新 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 配置文件中?
解决方案
推荐阅读
- bash - 使用 bash 在不同文件夹中动态执行函数
- javascript - 从 php array_push 创建 javascript 文件并循环
- asp.net-core - 我可以在我的 Web API 解决方案中使用 Microsoft.AspNetCore.Identity Nuget 吗?
- php - 如何从 PHP 状态页面获取一致的数据
- stripe-payments - 如何将 Stripe Checkout 与 charge.succeeded webhook 相匹配?
- python - Tkinter:单击按钮时函数调用并在您释放左键单击按钮时终止
- php - 无法在前端显示 get_term 输出
- r - 作为 dplyr 过滤功能的一部分,如何循环遍历列表的元素并最终在 R 中打印方差?
- c# - 为用作源的 SSIS 脚本组件动态创建输出和列
- java - 手动启动 Kafka 监听器后无法搜索