일부 색인 파일을 다운로드하지 못했습니다. 무시되었거나 대신 오래된 것이 사용되었습니다. WSL 2로 sudo apt 업데이트하는 경우

일부 색인 파일을 다운로드하지 못했습니다. 무시되었거나 대신 오래된 것이 사용되었습니다. WSL 2로 sudo apt 업데이트하는 경우
$ 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.
  • 시스템: 윈도우 10 프로 19044.1415

  • WSL 2, 우분투 20.04

pinggoogle.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

마침내 답변을 찾았습니다. 내 잘못도 아닌데...

이 조언나를 도왔고 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#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

관련 정보