$ 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.
Sistema: Windows 10 PRO 19044.1415
WSL 2, Ubuntu 20.04
ping
a google.com también falla:ping: google.com: Temporary failure in name resolution
Ya hecho:
wsl.conf
con esas líneas dentro de él:
[network]
generateResolvConf = false
- recreado
resolv.conf
con variosnameserver
's:
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 1.1.1.1
Intentó:
- para agregar
nameserver 8.8.8.8
awsl.conf
. No funciona. - mantener una sola
nameserver
línea dentro deresolv.conf
- seguidoesos pasos
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
deaquí
Pregunta reemplazada de StackOverflow
Respuesta1
Finalmente encontré una respuesta. Ni siquiera es mi culpa...
este consejoMe ayudó y sudo apt update
finalmente funcionó. Si no tiene .wslconfig
el archivo, créelo usted mismo.
Terminé con esto dentro de 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 -fuente
Respuesta2
Encontré que esto es relevante en mi caso:
https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#no-internet-access-in-wsl
Tuve que cerrar Symantec Network Threat Protection
Respuesta3
Escriba el siguiente comando y ejecútelo. Luego actualice nuevamente.
wget --no-check-certificate http.kali.org/kali/pool/main/k/kali-archive-keyring_2022.1_all.deb