Algunos archivos de índice no se pudieron descargar. Se han ignorado o se han utilizado en su lugar los antiguos. Cuando sudo apt actualiza con WSL 2

Algunos archivos de índice no se pudieron descargar. Se han ignorado o se han utilizado en su lugar los antiguos. Cuando sudo apt actualiza con WSL 2
$ 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

pinga google.com también falla:ping: google.com: Temporary failure in name resolution


Ya hecho:

  • wsl.confcon esas líneas dentro de él:
[network]
generateResolvConf = false
  • recreado resolv.confcon varios nameserver's:
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 1.1.1.1

Intentó:

  • para agregar nameserver 8.8.8.8a wsl.conf. No funciona.
  • mantener una sola nameserverlínea dentro deresolv.conf
  • seguidoesos pasos
  • New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allowdeaquí

Pregunta reemplazada de StackOverflow

Respuesta1

Finalmente encontré una respuesta. Ni siquiera es mi culpa...

este consejoMe ayudó y sudo apt updatefinalmente funcionó. Si no tiene .wslconfigel 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

información relacionada