Not all applications installation and uninstallation go smoothly. Sometimes application installation and uninstallation get interrupted or frozen due to various reasons such as a badly packaged app or accidental deletion of dependencies.
What this does is leaves traces of the program on your computer. Sometimes these traces are enough for elementary OS to think the app is installed correctly, while it isn’t. Moreover, the system won’t even let you reinstall the application. So you are stuck with a program that won’t work.
“App Center” isn’t useful in such a case as the program doesn’t show up in the list, assuming it was installed from there. It’s now time to go the command line way to delete the corrupt program.
We shall use the PURGE command. On my test PC, the application ‘Elementary Tweaks’ got partially uninstalled, and I’m going to use this scenario as an example for illustration.
Completely Remove Partially Installed Program
STEP 1: The first thing to know is the installed package name of the program you want to remove. Go to ‘Applications’ and launch ‘Terminal.’ Type the following command and hit enter. Make sure to replace [program name] with your program’s name.
sudo dpkg -l [program name]*
In my example, I will search for elementary-tweaks.
sudo dpkg -l elementary-tweaks*
In my case, the package name is the same. It may not be the same in your case. You will see the package name listed in the Terminal along with Name, Version, Architecture, and Description.
STEP 2: The next step is to use PURGE and remove the installed package. The generic format is:
sudo dpkg --purge [package name]
Replace the [package name] with your package name.
For my scenario, the command looks like this:
sudo dpkg --purge elementary-tweaks
Most of you should be good at this point, but for some an additional step may be needed if you still have broken dependencies. I suggest they run the following command-line in the Terminal.
sudo apt-get install -f
That’s it. The program should be entirely gone by now. Did it work for you? Do let us know in the comments below.