3

The store says WINE is installed, but I don't see it in my apps, or an option to use WINE to open a .exe file.

Zanna
  • 70,465
  • 2
    You could simply type in wine --version in a terminal window. – Terrance Mar 19 '18 at 04:08
  • @muru: I think the question is actually founded in the misunderstanding that WINE has a graphical user interface and/or creates an application starter for itself. – David Foerster Mar 19 '18 at 16:02
  • @DavidFoerster wine does usually add 2-3 launchers (one for uninstalling software, and a couple of others that I don't recall at the moment), and the Wine launcher should show up in the open with menu. – muru Mar 19 '18 at 23:49
  • @muru: I think those only appear (in the per-user application launcher directory) once you create your first Wine prefix. The only Wine-related application launcher on my system that doesn't have NoDisplay=true (and I didn't touch those in /usr/share/applications/) is for Winetricks which is a separate package. – David Foerster Mar 20 '18 at 00:04

3 Answers3

5

You can find installed WINE and WINE-related packages with the following command:

dpkg -l | grep ^ii | grep -i wine

You can find its default prefix with its size by

ls -ld ~/.wine
du -sh ~/.wine/*

and other prefixes (usually created by winetricks) with

ls -ld ~/.local/share/wineprefixes/*
du -sh ~/.local/share/wineprefixes/*
N0rbert
  • 99,918
3

To rightfully see if WINE is installed you should run:

which wine

The which command will either return an exit status of 0 if installed or a 1 if not installed...

To find the exit status of the command, simply run:

echo $?

It is a very simple yet important command to know about...

NerdOfCode
  • 2,498
  • +1 because it's the fastest and easiest way to check. But it should be mentioned, that this does not really look if something is installed. sudo touch /usr/bin/wine && chmod +x /usr/bin/wine would be enough to trick it. – pLumo Mar 19 '18 at 10:26
  • @RoVo True, but I doubt that would be applying in this case... But thanks for mentioning that! – NerdOfCode Mar 19 '18 at 11:19
  • Actually, while the exit code is 0 if installed and 1 if not, what which wine will output is the path where wine is installed, typically /usr/bin/wine – Elder Geek Mar 19 '18 at 17:33
  • This answer would be more useful if you either included how to obtain the exit code or what is displayed when wine is installed. – Elder Geek Mar 19 '18 at 17:42
  • 1
    +1. Added a use case for If condition ```#!/bin/bash winetricksInstalled() { command=$(which winetricks) return $(echo $?) } if $(winetricksInstalled) ; then echo "installed" else echo "Not installed" fi
    
    
    – PravyNandas Jul 06 '21 at 20:51
2

You can use the -s (status) switch of dpkg:

dpkg -s wine

Returns 0 if installed or 1 if the program is not installed.


Another way to see if a package is installed and which version (Installed: [...]). You also see which version would be installed (Candidate: [...]).

apt-cache policy <package name>
apt-cache policy wine

Advantage of apt-cache: You can use wildcards(*) if you don't know the exact package name.

pLumo
  • 26,947
  • 1
    Regarding dpkg -s wine: I'm not convinced that most users are even aware that they can obtain the exit code of a program with echo $? so the output of the command is likely more useful to most users than the exit code it returns. – Elder Geek Mar 19 '18 at 17:37