3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【WSL2】Kali-linuxでapt updateした時に「 Temporary failure」が発生した

Posted at

実行環境

  • OS: Windows11
  • WSL2
  • kali-linux
  • /etc/apt/sources.listはデフォルト

エラー内容

  1. WSL2のディストリビューションをkali-linuxに設定
  2. 「wsl -d kali-linux」でkali-linuxを起動
  3. 初回起動のため、「sudo apt update」を実施
  4. エラー発生
Error発生
└─$ sudo apt update
[sudo] password for kali:
Ign:1 http://http.kali.org/kali kali-rolling InRelease
Ign:1 http://http.kali.org/kali kali-rolling InRelease
Ign:1 http://http.kali.org/kali kali-rolling InRelease
Err:1 http://http.kali.org/kali kali-rolling InRelease
  Temporary failure resolving 'http.kali.org'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease  Temporary failure resolving 'http.kali.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

対処法

  1. 「sudo vi /etc/resolv.conf」を開く
  2. 「nameserver 8.8.8.8」を追加
    ※「ipconfig /all」で自分のDNSを調べて使用してもいい
# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 8.8.8.8
# 8.8.8.8: Google Public DNS

3.保存して閉じる
4.もう一度、「sudo apt update」を実施

通った!
Get:1 http://ftp.jaist.ac.jp/pub/Linux/kali kali-rolling InRelease [30.6 kB]
Get:2 http://ftp.jaist.ac.jp/pub/Linux/kali kali-rolling/main amd64 Packages [18.8 MB]
Get:3 http://ftp.jaist.ac.jp/pub/Linux/kali kali-rolling/contrib amd64 Packages [111 kB]
Get:4 http://ftp.jaist.ac.jp/pub/Linux/kali kali-rolling/non-free amd64 Packages [237 kB]
Fetched 19.2 MB in 8s (2,504 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
143 packages can be upgraded. Run 'apt list --upgradable' to see them.

参考文献

この記事は、以下の情報を参考にしました。

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?