⚙️

Kali Linux で Unable to locate package というエラーが出た時の対処法

2022/10/19に公開約2,600字

Kali Linux

sources.list

┌──(kali㉿kali)-[~]
└─$ sudo apt-get -y install gobuster
[sudo] password for kali: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package gobuster

gobuster などを追加でインストールしようとしたら上記のようなエラーが起きた

┌──(kali㉿kali)-[~]
└─$ cat /etc/apt/sources.list
# See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/
# deb https://http.kali.org/kali kali-rolling main contrib non-free

# Additional line for source packages
deb-src https://http.kali.org/kali kali-rolling main contrib non-free

そういう場合は、sources.list を以下のように変更する(上記はデフォルト)

┌──(kali㉿kali)-[~]
└─$ cat /etc/apt/sources.list
# See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/
# deb https://http.kali.org/kali kali-rolling main contrib non-free

# Additional line for source packages
# deb-src https://http.kali.org/kali kali-rolling main contrib non-free

deb http://http.kali.org/kali kali-rolling main contrib non-free 
deb-src http://http.kali.org/kali kali-rolling main contrib non-free

変更後、updata と upgrade を実行

┌──(kali㉿kali)-[~]
└─$ sudo apt-get update && sudo apt-get upgrade -y

再度、インストールを試す

┌──(kali㉿kali)-[~]
└─$ sudo apt -y install gobuster                   
[sudo] password for kali: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libexporter-tiny-perl libhttp-server-simple-perl liblist-moreutils-perl liblist-moreutils-xs-perl
  liblttng-ust-ctl4 liblttng-ust0 libpython3.9-minimal libpython3.9-stdlib libwacom-bin python3-dataclasses-json
  python3-limiter python3-marshmallow-enum python3-mypy-extensions python3-responses python3-spyse
  python3-token-bucket python3-typing-inspect python3.9 python3.9-minimal sphinx-rtd-theme-common
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  gobuster
0 upgraded, 1 newly installed, 0 to remove and 292 not upgraded.
Need to get 2,361 kB of archives.
After this operation, 7,636 kB of additional disk space will be used.
Get:1 http://ftp.halifax.rwth-aachen.de/kali kali-rolling/main amd64 gobuster amd64 3.2.0-0kali1 [2,361 kB]
Fetched 2,361 kB in 5s (462 kB/s)     
Selecting previously unselected package gobuster.
(Reading database ... 298581 files and directories currently installed.)
Preparing to unpack .../gobuster_3.2.0-0kali1_amd64.deb ...
Unpacking gobuster (3.2.0-0kali1) ...
Setting up gobuster (3.2.0-0kali1) ...
Processing triggers for kali-menu (2022.4.1) ...

うまくダウンロードできた。

Discussion

ログインするとコメントできます