Removing Wine completely

28,681

Solution 1

I think your first command is only purging the wine package, which is just a dependency for the others.

sudo apt-get purge "^wine.*"

should purge every package on your system starting with the word 'wine'.

Note that apt-get uses regular expressions for pattern matching, hence the ^ and .*

Solution 2

Simply running

sudo apt remove --purge wine*

should remove the wine packages and not result in any additional installations.

Sidenotes

  • * is acting as wildcard here
  • apt and apt-get are similar commands - while they are not 1:1 the same. apt seems to be the future.
  • --purge results in removing the user-related configs as well and not just the package itself

Solution 3

In my case, after conducting

sudo apt-get remove wine

Wine still appear in a dash. So I tried:

sudo apt-get purge wine

Which gave me an output:

The following packages were automatically installed and are no longer required: (...)
Use 'sudo apt autoremove' to remove them.

So when you get to this point, then you can run this command:

sudo apt-get autoremove

When I did that, wine disappeared from the dash.

Solution 4

purge remove

will remove about everything regarding the package packagename, but not the dependencies established during installation.

sudo apt-get purge --auto-remove [packagename]

This will remove the package along with the configuration files and dependencies.

You may like to have a walk through following links:

How to completely remove any program and its installation files?

What is the correct way to completely remove an application?

Share:
28,681

Related videos on Youtube

YouLethal
Author by

YouLethal

Updated on September 18, 2022

Comments

  • YouLethal
    YouLethal over 1 year

    Hoping someone can help me here with this issue I'm having. Wine isn't working on my Ubuntu 14.04LTS so I want to completely remove it and install from the software manager

    Code I'm using is as follows

    sudo apt-get purge wine
    

    Which shows

    wine            wine1.6         wine1.6-amd64   wine1.6-i386    wine-gecko2.21  wine-gecko2.34  wine-mono0.0.8  wine-mono4.5.4  winetricks
    

    So When I go to unistall using

    sudo apt-get remove wine1.6 --purge --no-install-recommends
    

    It uninstalls wine1.6 all fine but also then installs another version

    The following NEW packages will be installed
    
    
    wine1.8 wine1.8-amd64 wine1.8-i386:i386
    

    My question is how can I prevent wine1.8 from being installed as I want wine removed completely. Sorry if this is really simple I'm new to ubuntu and learning slowly

    Thanks, Youlethal

    • Mostafa Ahangarha
      Mostafa Ahangarha about 8 years
      Try updatedb command and then try to see if the which command would return the some result or not
    • Charles Green
      Charles Green over 6 years
      I'm voting for the duplicate, but I'm curious - why are you using --no-install-recommends for an uninstall process?
  • David Foerster
    David Foerster about 7 years
    That's effectively the same as Dhaval's answer. apt-get purge <PACKAGE> && apt-get autoremove is equivalent to apt-get purge --auto-remove <PACKAGE>.
  • Eliah Kagan
    Eliah Kagan over 6 years
    Don't do this! See Why does apt removes unwanted packages when giving * as suffix? The purge or remove action with an argument like wine*, wine\*, or 'wine*' removes way more than you might think. It removes every package with win anywhere in its name (not wine, win--as wine* is treated as a regex and e* means "zero or more es") and every package that depends directly or indirectly on any of those packages. This often breaks an Ubuntu system very badly, preventing it from being used for much of anything until it is fixed or reinstalled.
  • Eliah Kagan
    Eliah Kagan over 6 years
    This works and is safe, but you don't actually need the .* at the end (and, without it, the quotes become optional). That is, you can just use sudo apt-get purge ^wine. The presence of ^ is sufficient to cause the argument to be interpreted as a regular expression, and when apt or apt-get interprets an argument as a regular expression, it matches it anywhere in the package name. That's why you need ^--to anchor the match to the start of the package name. The regex doesn't need to match the entire package name, just any part of it.
  • Eliah Kagan
    Eliah Kagan over 6 years
    @DavidFoerster I think this is a different, nicer, easier, less error prone way. (a) In practice when one knows one needs autoremoval, it is often because one has already run an apt or apt-get command with the remove or purge action. So the method here is usually the one that is useful. (b) If one is unsure about whether or not one wants autoremoval, it's better to use these two separate steps. There's nothing wrong with purge --auto-remove--the other answer has value--but I wouldn't recommend getting in the habit of removing what one thinks are single packages in that way.
  • Reeshabh Ranjan
    Reeshabh Ranjan over 6 years
    So wine+ will do it?