I am using Ubuntu 18.04 and recently I have installed wine and it was not able to find the .dll files so I ran the command sudo apt-get remove winehq it showed that the wine has been uninstalled but when I type which wine I am getting the output /usr/bin/wine it seems it hasn't been uninstalled completely and when I try sudo apt-get purge wine* I am getting the following errors

E: Unable to locate package winehq.key
E: Couldn't find any package by glob 'winehq.key'
E: Couldn't find any package by regex 'winehq.key'

Output of apt list --installed | grep wine:

WARNING: apt does not have a stable CLI interface. Use with caution in scripts. 
wine-devel/bionic,now 4.0~rc3~bionic amd64 [installed,automatic] 
wine-devel-amd64/bionic,now 4.0~rc3~bionic amd64 [installed,automatic] 
wine-devel-i386/bionic,now 4.0~rc3~bionic i386 [installed,automatic] 
winehq-devel/bionic,now 4.0~rc3~bionic amd64 [installed] winetricks/bionic,bionic,now 0.0+20180217-1 all [installed]

What am I doing wrong and how to complete remove everying that is related to wine and install install it properly

  • Please run sudo dpkg --configure -a Dec 30 '18 at 17:01
  • Please explain clearly all the different ways you used to install Wine, including any failed attempts.
    – user535733
    Dec 30 '18 at 17:20

You seem to have installed wine's development version (a.k.a. beta) which can be unstable sometimes. To remove wine, run:

sudo apt autoremove wine-devel wine-devel-amd64 wine-devel-i386 winehq-devel winetricks

I'll recommend you to install wine-stable to have a wine with minimal bugs. To install it run:

sudo apt install wine-stable

You can uninstall all dependencies related to wine

sudo apt-get remove --autoremove wine-*
  • 1
    worked for me on ubuntu 18.04
    – Max Svid
    Mar 17 '20 at 18:19
  • 1
    For me too, on Ubuntu 20.04, and unlike the solution proposed in the accepted answer.
    – Delio M.
    Oct 27 '20 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.