$ 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
WSL2、Ubuntu 20.04
ping
google.com への接続も失敗します:ping: google.com: Temporary failure in name resolution
すでに完了:
wsl.conf
その中に次の行があります:
[network]
generateResolvConf = false
- いくつかの's
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
内側に1行を残すresolv.conf
- 続いてこれらのステップ
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
からここ
StackOverflow から置き換えられた質問
答え1
ついに答えが見つかりました。私のせいでもないのに...
このアドバイス助かりました、そしてsudo apt update
ついにうまくいきました。ファイルがない場合は.wslconfig
、自分で作成してください。
最終的に内部は次のようになりましたresolv.conf
:
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 1.1.1.1
nameserver 208.67.222.222 # OpenDNS address
nameserver 192.168.0.10 # ipv4 address of your windows machine. *1
*1 -ソース
答え2
私の場合にはこれが当てはまることがわかりました:
https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#wsl でインターネットにアクセスできない
Symantec Network Threat Protectionをシャットダウンする必要がありました
答え3
以下のコマンドを入力して実行します。その後、再度更新します。
wget --no-check-certificate http.kali.org/kali/pool/main/k/kali-archive-keyring_2022.1_all.deb