How do I restore my system OS back to its original condition after attempting to install Kali linux tools onto Ubuntu 16.04?
I was attempting to install some Kali linux tools onto my computer running Ubuntu 16.04 using katoolin, and the majority of it worked out and installed properly, but when I tried to upgrade it an error came up. Eventually after some tinkering, the available updates from katoolin disappeared. Now when I boot Ubuntu does not even show up as Ubuntu, it says Kali Linux on the GRUB menu instead. I am not sure how to go about attempting to solve any of these problems as I am pretty new to Linux, so I was hoping someone out there could help.
Also, as of now GNOME is not loading, so I am at the stage of using a virtual console (I got there by pressing Ctrl+Alt+F1).
Solution 1:
Start Ubuntu from a virtual console
-
Open a text-only virtual console by using the keyboard shortcut Ctrl+Alt+F3.
-
At the
login:
prompt type your username and press Enter. -
At the
Password:
prompt type your user password and press Enter. -
Now you are logged in to a text-only console, and you can run terminal commands from the console.
Warning about updates after installing Kali linux tools
The LionSec Katoolin GitHub webpage clearly warns Katoolin users to be careful when updating software.
Before updating your system, please remove all Kali-linux repositories to avoid any kind of problem.
All kinds of problems can occur if you don't do this.
-
Make a backup copy of sources.list.
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
-
Open
/etc/apt/sources.list
for editing in nano text editor:sudo nano /etc/apt/sources.list
-
Replace the entire contents of your existing sources.list with the following default 16.04 sources.list:
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse deb http://archive.canonical.com/ubuntu xenial partner
-
Press the keyboard combination Ctrl+O and after that press Enter to save the file being edited. Press the keyboard combination Ctrl+X to exit nano.
-
Run this command after changing sources.list to refresh the list of available software. This is the most important step, so please don't skip it.
sudo apt update
-
Remove Katoolin.
sudo rm -r /usr/bin/katoolin
-
Reinstall the Ubuntu desktop system.
sudo apt-cache depends ubuntu-desktop | grep '[ |]Depends: [^<]' | cut -d: -f2 | tr -d ' ' | xargs sudo apt-get --reinstall install -y
-
Temporarily enable os-prober in grub by setting
GRUB_DISABLE_OS_PROBER=false
in/etc/default/grub
. -
Install grub to the MBR of your boot drive with these commands:
sudo apt-get --reinstall install base-files/xenial-updates sudo os-prober sudo update-grub
-
Reboot.
sudo reboot
-
For security reasons disable os-prober in grub by setting
GRUB_DISABLE_OS_PROBER=true
in/etc/default/grub
. -
Run autoremove.
sudo apt autoremove
-
Install deborphan.
sudo apt install deborphan
-
Run
deborphan
to show a list of packages orphaned after uninstalling Katoolin. These orphaned packages are no longer necessary except if you are still using any of the packages that were installed by Katoolin.