I installed several Kali tools using the Katoolin script. After a while I tried to uninstall these tools, I was able to remove most of them but several apps won't uninstall using
sudo apt-get remove <package name>
command.
I get: E: Unable to locate package <package name>
.
Also tried using sudo apt autoremove <package name>
with same result.
I'm assuming the actual package installed under a different name from the one I'm seeing in the Applications window. How can I remove these packages or find their actual name?
apt
can only uninstall packages that where installed by apt or applications that use apt as a back-end like Ubuntu Software or Synaptic. The results ofapt policy searchsploit snmp-check ssltrip thcping6
show that none of these 4 packages are from the default Ubuntu repositories. These packages were installed by Katoolin, which is a script that helps to install Kali Linux tools on Ubuntu and other Linux distributions. Katoolin adds its own repositories to Ubuntu's software sources, so it is possible that these 4 packages were installed by apt anyway, but Katoolin can also install packages from GitHub and other sources that do not always provide .deb files that apt can install in which case check this question: If I build a package from source how can I uninstall or remove completely?.Even if a package was installed with apt, it can only be uninstalled by running a command which includes its exact package name. Package names in Ubuntu are case sensitive and pieces of package names are not interpreted by
apt
to be exact package names. However if you know a piece of a package's name, you can easily find the full package name by running a command like this:This command returns packages that start with the string
rhythmb
, for example rhythmbox. Alternatively you can run a command like this:This command returns packages that contain the 5.4.0-48 string (a Linux kernel version) anywhere in their names.
Do not assume that any feature is provided by a package that has the same name as that feature. Multiple commands may be provided by the same package which has a different name than any of the programs and commands that it provides.
However you can easily find the package name from the exact name of a command as follows. Here is an example using the
xdg-open
command which opens a file or URL in the user's preferred application .The above command returns
/usr/bin/xdg-open
.The above command returns
xdg-utils: /usr/bin/xdg-open
which shows that thexdg-open
command is provided by the xdg-utils package.Karel’s answer is correct but here’s another angle: if the package that you want to remove is unknown to the package manager it can’t be installed at the same time, meaning that there is no further need to remove it.