Ubuntu 20.04.5 LTS 64位系统安装Kali工具及katoolin执行报错求助
Hey there! Let's troubleshoot that "No such file or directory" error you're hitting with katoolin. I've run into similar issues before, so here are some straightforward fixes to get you up and running:
1. Fix the execution path issue
You mentioned you placed katoolin in /usr/bin/ and made it executable, but you're running ./katoolin — that's the first problem! The ./ prefix tells your system to look for the file in your current working directory, not in /usr/bin/.
Since /usr/bin is part of your system's default PATH, you can just run the command directly without the ./:
katoolin
Or, since katoolin needs admin privileges to install tools, it's better to run it with sudo:
sudo katoolin
2. Verify the katoolin file actually exists in /usr/bin
Let's double-check that the file was properly placed in the right directory. Run this command to list the file details:
ls -l /usr/bin/katoolin
If you get an error saying the file doesn't exist, that means your earlier step to copy or download katoolin to /usr/bin failed. You'll need to re-add the script to that directory first.
3. Check the script's shebang line
Sometimes even if the file exists, a mismatched shebang (the first line of the script that tells the system which interpreter to use) can cause this error. Ubuntu 20.04 uses Python 3 as the default, but some older katoolin versions might reference Python 2.
To check the shebang line:
cat /usr/bin/katoolin | head -1
If it shows #!/usr/bin/python, edit the script to use Python 3 instead:
sudo nano /usr/bin/katoolin
Change the first line to #!/usr/bin/python3, save the file (Ctrl+O, then Enter) and exit (Ctrl+X). Then try running sudo katoolin again.
4. Reinstall katoolin from scratch (if all else fails)
If the above steps don't work, let's start fresh:
- First, remove the existing (possibly broken) file:
sudo rm /usr/bin/katoolin - Get the latest katoolin script and save it directly to
/usr/bin:
(Note: You can grab the official script from its code repository and save it as/usr/bin/katoolin) - Add executable permissions again:
sudo chmod +x /usr/bin/katoolin - Run it with sudo:
sudo katoolin
Once katoolin launches successfully, you can follow the prompts to install the Kali tools you need. Let me know if you hit any other snags!
备注:内容来源于stack exchange,提问作者user775423

