How to Install and Use Wine on Ubuntu 16.04 or 18.04

This post will guide you how to install and use Wine on your Ubuntu Linux 16.04 or 18.04. How do I install the latest Wine Tool from the Default official Wine repository on your Ubuntu system. How to uninstall wine from your Ubuntu system.

install and use wine on ubuntu12

What is Wine?


Wine is a free and open source compatibility layer that can be used to run Microsoft Windows program on Unix-like operating system, such as: Linux, Unix, or FreeBSD systems.

Wine is also provide a software library, called Winelib, it can be used to help developers to port Windows applications to Unix-like systems.

Wine is not an Emulator of Unix-like system, it is a interface that used to translate windows system calls into equivalent POSIX calls used by Unix-like system.

So far, Wine tool can support thousands of windows applications to be run on Unix-like system normally.

At the time of writing this post, the stable version of Wine is 4.0. It is announced on January 22, 2019. You can download its source code from its official site of WineHQ. You can also use the APT Tool to install Wine on Ubuntu system. And the latest development version of Wine 4.7 is released. And Wine team has announced the latest wine development release 4.7 on April 26, 2019.

What is New in Wine 4.7?


The key changes that comes with Wine 4.7 as stated in its official announcement are as below:

  • Support for built-in libraries in PE format even on Unix.
  • Updated version of the Mono engine.
  • More implementation of the Debug Engine DLL.
  • Support for the Command Link standard control.
  • Improved Edit control sizing in CJK locales.
  • Various bug fixes.

You can get the source package of Wine 4.7 from here.

Installing Wine From Default APT Repository


The Wine is already available on the default Ubuntu repositories. But it may be not the latest version. If you want to install Wine 3.0 on your Ubuntu system, you can directly install it from the Ubuntu default APT repository, just use the following command to install wine 3.0:

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install wine64

Outputs:

devops@ubuntu:~$ sudo apt install wine64
[sudo] password for devops:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
......
ocl-icd-libopencl1:i386 wine-stable wine32:i386 zlib1g:i386
Suggested packages:
......
libwine-gecko-2.47:i386 wine32-preloader:i386 libwine-gecko-2.47
wine64-preloader
The following NEW packages will be installed:
......
ocl-icd-libopencl1
ocl-icd-libopencl1:i386 wine-stable wine32:i386 wine64 zlib1g:i386
0 upgraded, 169 newly installed, 0 to remove and 22 not upgraded.
Need to get 104 MB of archives.
After this operation, 752 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y

You need to press y key when you are prompted with a Y/n prompt for installation of Wine. After installed, the Wine Application should be installed and ready for use on your Ubuntu system.

If you are using 32-bit Ubuntu system, you need to use the following apt install command to install wine, type:

$ sudo apt install wine32

You can check the installation of Wine by verifying the version of Wine with the following command:

$ wine --version

Outputs:

$ wine --version
wine-3.0 (Ubuntu 3.0-1ubuntu1)

Installing Wine from Default Wine Official Repository


If you want to install the latest stable version of Wine application, you should be better to install it from wineHQ repository. And the current latest stable version is Wine 4.0. Just do the following steps:

#1 Enable 32-bit architecture firstly, if your system is 64 bit, type:

$ sudo dpkg --add-architecture i386

#2 Download and add the repository key to your system, using the following commands:

$ wget -nc https://dl.winehq.org/wine-builds/winehq.key
$ sudo apt-key add winehq.key

Outputs:

devops@ubuntu:~$ wget -nc https://dl.winehq.org/wine-builds/winehq.key
--2019-05-05 02:34:19-- https://dl.winehq.org/wine-builds/winehq.key
Resolving dl.winehq.org (dl.winehq.org)... 151.101.110.217
Connecting to dl.winehq.org (dl.winehq.org)|151.101.110.217|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3220 (3.1K) [application/pgp-keys]
Saving to: ‘winehq.key’

winehq.key 100%[=========================>] 3.14K --.-KB/s in 0s

2019-05-05 02:34:21 (20.9 MB/s) - ‘winehq.key’ saved [3220/3220]

devops@ubuntu:~$ sudo apt-key add winehq.key
OK

#3 Add the WineHQ repository in your system based on your Ubuntu system and version.

For Ubuntu 19.04,type:

$ sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ disco main'

For Ubuntu 18.10, type:

$ sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ cosmic main'

For Ubuntu 18.04, type:

$ sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'

For Ubuntu 16.04, type:

$ sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'

Outputs:

devops@ubuntu:~$ sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
Hit:1 http://mirrors.aliyun.com/ubuntu bionic InRelease
Hit:2 http://mirrors.aliyun.com/ubuntu bionic-security InRelease
Hit:3 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease
Hit:4 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease
Hit:5 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease
Get:6 https://dl.winehq.org/wine-builds/ubuntu bionic InRelease [6,257 B]
Get:7 https://dl.winehq.org/wine-builds/ubuntu bionic/main i386 Packages [382 kB]
Get:8 https://dl.winehq.org/wine-builds/ubuntu bionic/main amd64 Packages [364 kB]
Fetched 752 kB in 2s (447 kB/s)
Reading package lists... Done

#4 install the latest Wine from the APT repository with the following command:

$ sudo apt update
$ sudo apt install --install-recommends winehq-stable

Outputs:

devops@ubuntu:~$ sudo apt-get install --install-recommends winehq-stable
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
......
ocl-icd-libopencl1:i386 wine-stable wine-stable-amd64 wine-stable-i386:i386
zlib1g:i386
Suggested packages:
......
ocl-icd-libopencl1:i386 wine-stable wine-stable-amd64 wine-stable-i386:i386
winehq-stable zlib1g:i386
0 upgraded, 172 newly installed, 0 to remove and 0 not upgraded.
Need to get 112 MB of archives.
After this operation, 813 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
......
Setting up libsdl2-2.0-0:i386 (2.0.8+dfsg1-1ubuntu1.18.04.3) ...
Setting up libsane1:i386 (1.0.27-1~experimental3ubuntu2) ...
Setting up libtheora0:i386 (1.1.1+dfsg.1-14) ...
Setting up libglx0:i386 (1.0.0-2ubuntu2.2) ...
Setting up gstreamer1.0-plugins-base:i386 (1.14.1-1ubuntu1~ubuntu18.04.2) ...
Setting up wine-stable-i386:i386 (4.0~bionic) ...
Setting up libgl1:i386 (1.0.0-2ubuntu2.2) ...
Setting up libglu1-mesa:i386 (9.0.0-2.1build1) ...
Setting up wine-stable (4.0~bionic) ...
Setting up libgl1-mesa-glx:i386 (18.2.8-0ubuntu0~18.04.2) ...
Setting up winehq-stable (4.0~bionic) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...

Note: if you have previously installed a Wine package from another repository, you need to remove it and any packages that depend it. Before attempting to install the WineHQ packages, as they may cause dependency conflicts.

There are three options about which release of Wine you want to install: Stable version, Development version, and Staging version.

If you want to install the latest development version of Wine, just using the following apt command:

$ sudo apt install --install-recommends winehq-devel

If you want to install the latest staging version of Wine, just using the following apt command:

$ sudo apt install --install-recommends winehq-staging

If you also got the unmet dependencies error during installation of Wine from the WineHQ default repository as followsing error messages:

The following packages have unmet dependencies:
winehq-stable : Depends: wine-stable (= 4.0~cosmic) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

You can use the following command to install the stable version of WineHQ with aptitude tool, type:

$ sudo apt install aptitude
$ sudo aptitude install winehq-stable

After installed Wine Packge, you can verify the Wine installation by checking the version of Wine, type:

$ wine --version

Outputs:

devops@ubuntu:~$ wine --version
wine-4.0

Configuring Wine


Once Wine installed on your system, you can start to configure your Wine Application by running the following command:

$ wincfg

Then application will prompt you to install Mono and Gecko to be used to set up your Wine environment. The Wine Mono Installer dialog box will appear. You just need to click Install button.

install and use wine on ubuntu1

Then the Wine Mono tool should be downloaded and installed it on your system.

install and use wine on ubuntu2

Next, the Wine Gecko Installer dialog box will appear, click Install button. And the Gecko should be installed.

install and use wine on ubuntu3

Last, the Wine Configuration window box will appear. You can try to configure various Wine settings, such as: Audio, Graphics, Libraries, Drives, etc.

install and use wine on ubuntu4

install and use wine on ubuntu5

Installing or Launching Windows Application using Wine


After configured Wine Environment, you can try to install or start a windows application on your Ubuntu Linux system.

At this post, we will show you how to start a Putty.exe windows application on your system. Firstly, you need to launch your Firefox browser to download the Putty.exe program from the Putty official web page.

install and use wine on ubuntu6

Then go the download directory on your system to find your putty.exe file, and right click on it, select Open With Other Application from the pop-up menu list, and then select Wine Windows Program Loader option from the Recommended Applications list box. click Select button.

install and use wine on ubuntu11

install and use wine on ubuntu9

Putty application will be launched on your Ubuntu system.

install and use wine on ubuntu10

Uninstalling Wine


If you want to remove Wine from your system, you can execute the following apt command in your Ubuntu terminal, type:

$ sudo apt purge winehq-stable

Outputs:

devops@ubuntu:~$ sudo apt purge winehq-stable
[sudo] password for devops:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
winehq-stable*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 73.7 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 171318 files and directories currently installed.)
Removing winehq-stable (4.0~bionic) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...

Conclusion


You should know that how to install and use Wine on your Ubuntu 16.04 or 18.04 or Debian Linux. You also should know that how to start a Windows Application under Wine environment on Ubuntu system.

You might also like:

Sidebar



back to top