GUI
A convenient option to uninstall using the GUI is to run Software Center or Application Center, find the application by name and if it is marked as installed, uninstall it.
CLI
The method of uninstallation depends very much on the way the application was installed. Some of typical options are:
- Installing using the
apt command and the repository, or from a local deb file
- Snap installation
- Flatpak installation
- AppImage installation
- Install from a
tar, tar.gz or tgz file
Survey before uninstallation
The first three types are relatively easy to identify using the following commands. They are arranged to match installation type from 1. to 3.
dpkg -l | grep -i yubi
sudo snap list | grep -i yubi
sudo flatpak list | grep -i yubi
A successful finding is indicated by a non-empty output of the grep command, which is always listed at the end of the search command.
The output contains the name of the installed package or snap, e.g. <package_name>
A query using dpkg sometimes generates installation candidate notifications (rc) instead of the installed package (ii). The characters ii or rc appear right at the beginning of the line. The rc characters indicate that the package is NOT installed locally.
Ways to uninstall
Type 1, DEB package
sudo dpkg -r <package_name>
Type 2, Snap package
sudo snap remove <package_name>
Type 3, Flatpak package
sudo flatpak uninstall <package_name>
Note that in this third case the package name must contain the full identifier, as shown in the response of command sudo flatpak list | grep -i yubi in the Application ID column.
For example, for Yubico Authenticator, the Flatpak identifier is a string of characters com.yubico.yubioath
and an example of uninstalling is:
sudo flatpak uninstall com.yubico.yubioath
Type 4, AppImage
Search for AppImage file
sudo find / -iname "*yubikey-manager*"
Remove file
sudo rm /path/to/file/filename.AppImage
Real file name is e.g. yubikey-manager-qt-1.2.5-linux.AppImage
For more detail see https://stackoverflow.com/questions/43680226/how-do-i-uninstall-a-program-installed-with-the-appimage-launcher
or How to completely uninstall the standalone (appimage) app called Etcher from Ubuntu?.
Type 5, installed from tar, tar.gz, tgz archive file
The last fifth option has more variants and can be more complicated.
The basis of success of a simple solution is to find the unpacked archive file from which the application was installed. When this succeeds, the uninstall command is in one of the variants
sudo make uninstall
Sometimes the tar archive includes a script for uninstalling uninstall:
sudo ./uninstall
etc.