TL;DR:
It's not Katoolin which crashes Ubuntu. Instead they are the packages from the Kali repositories which replaces that of Ubuntu. So, Do not update and upgrade your Ubuntu installation while Kali's repository is in use.
What issues may occur?
Katoolin's Python Script basically adds repository information of Kali which looks like this:
# Kali linux repositories | Added by Katoolin
deb http://http.kali.org/kali kali-rolling main contrib non-free
Since now the repository information of Kali is also in use, APT might think that the new version of packages are available. APT would try to "update" those packages and replace the Ubuntu packages with those of Kali. This might create severe dependency issues which is even impossible to solve. If you are brave enough and try to solve that, you might face dpkg error: "trying to overwrite file, which is also in..." kind of problem. And if you overwrite that forcefully you might end up with a broken system in which it's even impossible to connect to the internet since configuration might be horribly affected. And the worst thing is that you would be using Kali, not Ubuntu, after that.
How do I remove the repository information of Kali?
According to this answer about the warnings LionSec Katoolin GitHub states, so there's no need to keep those repository information in sources.list unless you want to update those tools. Ubuntu automatically checks for updates once a day, therefore, even if sudo apt update
command isn't run manually, it will be run automatically.
The script do provide an option to remove those repositories under "Add Kali repositories & Update" option. These are the lines of code that are inspired from the script and removes the Kali's repository information.
#!/usr/bin/python3
import os
infile = "/etc/apt/sources.list"
outfile = "/etc/apt/sources.list"
delete_list = ["# Kali linux repositories | Added by Katoolin\n", "deb http://http.kali.org/kali kali-rolling main contrib non-free\n"]
fin = open(infile)
os.remove("/etc/apt/sources.list")
fout = open(outfile, "w+")
for line in fin:
for word in delete_list:
line = line.replace(word, "")
fout.write(line)
fin.close()
fout.close()
To download and run the above Python 3 code, run:
git clone https://github.com/kulfy1/Katoolin_removal/blob/master/script.py
sudo chmod +x script.py
sudo ./script.py
Or comment the line which is equal to deleting the information using sed
:
sudo sed -e '/kali/ s/^/#/' -i /etc/apt/sources.list
And then finally run:
sudo apt update
Is there any safer method to install the tools then?
Having a safer and convenient method doesn't exist as far as I know. If you want convenience, then it won't be safe unless you are careful. If you are careless, go for safer method. The safer method simply includes determining the dependencies of the package needed, downloading the deb packages from Kali Archives, and finally installing using DPKG using the command
sudo dpkg -i file.deb
Since this method won't alter the sources.list, so there's nothing to worry about. But on the other side, it requires manual determination of dependencies and installing thereafter, so it may be full of hassles.
I wasn't aware of the harms and I updated my Ubuntu installation without removing Kali's repositories. What do I do now?
When the upgrade
is run, it shows thousands of packages will be upgraded. That's the moment when you can think once again if there's something missing or something extra. But if the upgrade has been already done, it might possibly fail affecting hundreds of packages. Then the dependency issues will arise. And if you satisfy them forcefully, you'll end up with a broken installation. If lsb_release -a
shows Kali, then the destructive things have already happened.
If you try to make it "Ubuntu" again, it would be too-broad, full of hassles and near to impossible. The reinstallation will take lesser time and will be more convenient. So, the only solution is to backup the data and install Ubuntu from scratch. And be aware of the Kali repositories in future.