Menu leftovers after wine was removed
Wine (Wine Is Not an Emulator) is a great Linux program used to run Windows programs within Linux. Unfortunately it doesn’t really clean itself up well if you remove it from Ubuntu using apt-get remove, apt-get purge, or Ubuntu Software Centre. Residue, like these installed Windows programs sit in your Gnome menu.
At first I thought fixing this was a matter of just using the purge switch with apt-get, so I tried reinstalling wine and running:
sudo apt-get purge wine
No luck. So I tried purge with the other dependencies, but the wine menu options stuck. So I Googled around and found this Linux forums thread which unfortunately didn’t give a solution that works. Some of the advice on the thread is sound, particularly the purge part, but it doesn’t solve the menu or installed software part.
As it happens I already knew that all Wine installed software is stored under a “dot” folder named .wine in my user home directory. I’d already removed wine, so to remove the actual programs (Google Chrome and the Cheat Engine) I went to my home directory and did ran:
rm -rf ~/.wine
The tilde replaces your /home/username. I could have typed rm -rf /home/charles/.wine but I like saving keystrokes. But this command only removes the programs, it doesn’t actually remove the entries in the gnome menu.
I also remembered that the ~/config folder contains a lot of user-side configuration options, and I figured it was the best place to start looking for the wine menu. Sure enough in ~/.config/menus/applications-merged I found the following files:
wine-Programs-Cheat Engine 6.1-Cheat Engine 6.1 (32-bit).menu
wine-Programs-Cheat Engine 6.1-Cheat Engine 6.1 (64-bit).menu
wine-Programs-Cheat Engine 6.1-Cheat Engine 6.1.menu
wine-Programs-Cheat Engine 6.1-Cheat Engine help.menu
wine-Programs-Cheat Engine 6.1-Cheat Engine tutorial.menu
wine-Programs-Cheat Engine 6.1-Kernel stuff-Unload kernel module.menu
wine-Programs-Cheat Engine 6.1-main.lua.menu
wine-Programs-Cheat Engine 6.1-Reset settings.menu
wine-Programs-Cheat Engine 6.1-Uninstall Cheat Engine.menu
wine-Programs-Google Chrome-Google Chrome.menu
wine-Programs-Google Chrome-Uninstall Google Chrome.menu
I changed into the directory and removed the files:
Checking the menu reveals no more wine menu or programs in the menu. Of course if you just want to remove the menu entries and you don’t want to delete the Windows programs (Cheat Engine and Chrome) just don’t run the rm -rf ~/.wine command.
Wine menu is removed from Gnome