$ sudo apt 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
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://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.
系統:Windows 10 PRO 19044.1415
WSL 2、Ubuntu 20.04
ping
到 google.com 也失敗:ping: google.com: Temporary failure in name resolution
已經完成了:
wsl.conf
裡面有這些行:
[network]
generateResolvConf = false
resolv.conf
用幾個重新創建nameserver
:
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 1.1.1.1
嘗試過:
- 添加
nameserver 8.8.8.8
到wsl.conf
.不起作用。 nameserver
在其中保留單行resolv.conf
- 已關注那些步驟
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
從這裡
問題由 StackOverflow 替換
答案1
答案2
我發現這與我的情況有關:
https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#no-internet-access-in-wsl
我不得不關閉 Symantec Network Threat Protection
答案3
輸入下面的命令並運行它。然後再更新。
wget --no-check-certificate http.kali.org/kali/pool/main/k/kali-archive-keyring_2022.1_all.deb