Wine is an open-source compatibility layer that allows you to run Windows applications on Unix-like operating systems such as Linux, FreeBSD, and macOS. It is an interface that translates Windows system calls into equivalent POSIX calls used by Linux and other Unix-based operating systems.
For Linux users, Wine is a saviour when running Windows-based applications on UNIX systems. However, not all Windows applications will run in Wine and may have strange crashes or bugs. The Wine AppDB is a database containing a list of applications that have been tested and confirmed to work under Wine.
You will learn how to install and configure Wine on Ubuntu 20.04 LTS operating system in the following guide.
Table of Contents
- Ubuntu 20.04.2.0 LTS (Focal Fossa) Server or Desktop
- Root access or Sudo user privileges.
- Git installed on your server.
- wget or curl installed
Check and update your Ubuntu 20.04 operating system.
sudo apt update && sudo apt upgrade -y
Make sure either curl and wget are installed.
sudo apt install wget curl
Before moving on to install Wine for Ubuntu 20.04, you will need to enable the 32-bit architecture on your operating system. This is because most of the Windows applications are built for 32-bit architecture. The first step is to facilitate multiarch, which allows you to install both 64 and 32-bit packages on the machine:
sudo dpkg --add-architecture i386 && sudo apt update -y
Install Wine 5.0
Ubuntu 20.04 Focal Fossa repositories come with Wine 5.0 through the APT package manager. This is the most common way to install Wine. However, it must be noted that updates to the package manager are rare. Wine does a fair bit of development releases, so you will find yourself lagging eventually.
To install Wine version 5 64bit and 32bit, type the following command:
sudo apt install wine64 wine32
You will get the following extended package output:
$ sudo apt install wine64 wine32 Reading package lists… Done Building dependency tree Reading state information… Done The following additional packages will be installed: fonts-wine gcc-10-base:i386 glib-networking:i386 gstreamer1.0-plugins-base:i386 gstreamer1.0-plugins-good:i386 gstreamer1.0-x:i386 i965-va-driver i965-va-driver:i386 intel-media-va-driver intel-media-va-driver:i386 libaa1:i386 libaom0 libaom0:i386 libapparmor1:i386 libasn1-8-heimdal:i386 libasound2:i386 libasound2-plugins:i386 libasyncns0:i386 libatomic1:i386 libavahi-client3:i386 libavahi-common-data:i386 libavahi-common3:i386 libavc1394-0:i386 libavcodec58 libavcodec58:i386 libavutil56 libavutil56:i386 libblkid1:i386 libbrotli1:i386 libbsd0:i386 libbz2-1.0:i386 libc6:i386 libcaca0:i386 libcairo-gobject2:i386 libcairo2:i386 libcap2:i386 libcapi20-3 libcapi20-3:i386 libcdparanoia0:i386 libcodec2-0.9 libcodec2-0.9:i386 libcom-err2:i386 libcrypt1:i386 libcups2:i386 libcurl3-gnutls:i386 libdatrie1:i386 libdb5.3:i386 libdbus-1-3:i386 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libdv4:i386 libedit2:i386 libelf1:i386 libexif12:i386 libexpat1:i386 libfaudio0 libfaudio0:i386 libffi7:i386 libflac8:i386 libfontconfig1:i386 libfreetype6:i386 libfribidi0:i386 libgcc-s1:i386 libgcrypt20:i386 libgd3:i386 libgdbm-compat4:i386 libgdbm6:i386 libgdk-pixbuf2.0-0:i386 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386 libglib2.0-0:i386 libglu1-mesa:i386 libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libgmp10:i386 libgnutls30:i386 libgomp1:i386 libgpg-error-l10n libgpg-error0:i386 libgphoto2-6:i386 libgphoto2-port12:i386 libgpm2:i386 libgraphite2-3:i386 libgsm1 libgsm1:i386 libgssapi-krb5-2:i386 libgssapi3-heimdal:i386 libgstreamer-plugins-base1.0-0:i386 libgstreamer-plugins-good1.0-0:i386 libgstreamer1.0-0:i386 libgudev-1.0-0:i386 libharfbuzz0b:i386 libhcrypto4-heimdal:i386 libheimbase1-heimdal:i386 libheimntlm0-heimdal:i386 libhogweed5:i386 libhx509-5-heimdal:i386 libicu66:i386 libidn2-0:i386 libiec61883-0:i386 libieee1284-3:i386 libigdgmm11 libigdgmm11:i386 libjack-jackd2-0:i386 libjbig0:i386 libjpeg-turbo8:i386 libjpeg8:i386 libk5crypto3:i386 libkeyutils1:i386 libkrb5-26-heimdal:i386 libkrb5-3:i386 libkrb5support0:i386 liblcms2-2:i386 libldap-2.4-2:i386 libllvm11:i386 libltdl7:i386 liblz4-1:i386 liblzma5:i386 libmount1:i386 libmp3lame0:i386 libmpg123-0:i386 libmysqlclient21:i386 libncurses6:i386 libncursesw6:i386 libnettle7:i386 libnghttp2-14:i386 libnuma1:i386 libodbc1 libodbc1:i386 libogg0:i386 libopenal-data libopenal1 libopenal1:i386 libopenjp2-7:i386 libopus0:i386 liborc-0.4-0:i386 libosmesa6 libosmesa6:i386 libp11-kit0:i386 libpango-1.0-0:i386 libpangocairo-1.0-0:i386 libpangoft2-1.0-0:i386 libpcap0.8:i386 libpci3:i386 libpciaccess0:i386 libpcre2-8-0:i386 libpcre3:i386 libperl5.30:i386 libpixman-1-0:i386 libpng16-16:i386 libproxy1v5:i386 libpsl5:i386 libpulse0:i386 libraw1394-11:i386 libroken18-heimdal:i386 librsvg2-2:i386 librsvg2-common:i386 librtmp1:i386 libsamplerate0:i386 libsane:i386 libsasl2-2:i386 libsasl2-modules:i386 libsasl2-modules-db:i386 libsdl2-2.0-0 libsdl2-2.0-0:i386 libselinux1:i386 libsensors5:i386 libshine3 libshine3:i386 libshout3:i386 libslang2:i386 libsnappy1v5 libsnappy1v5:i386 libsndfile1:i386 libsndio7.0 libsndio7.0:i386 libsnmp35:i386 libsoup2.4-1:i386 libsoxr0:i386 libspeex1:i386 libsqlite3-0:i386 libssh-4:i386 libssl1.1:i386 libstb0 libstb0:i386 libstdc++6:i386 libswresample3 libswresample3:i386 libsystemd0:i386 libtag1v5:i386 libtag1v5-vanilla:i386 libtasn1-6:i386 libthai0:i386 libtheora0:i386 libtiff5:i386 libtinfo6:i386 libtwolame0:i386 libudev1:i386 libunistring2:i386 libusb-1.0-0:i386 libuuid1:i386 libv4l-0:i386 libv4lconvert0:i386 libva-drm2 libva-drm2:i386 libva-x11-2 libva-x11-2:i386 libva2 libva2:i386 libvdpau1 libvdpau1:i386 libvisual-0.4-0:i386 libvkd3d1 libvkd3d1:i386 libvorbis0a:i386 libvorbisenc2:i386 libvpx6:i386 libvulkan1:i386 libwavpack1:i386 libwayland-client0:i386 libwayland-cursor0:i386 libwayland-egl1:i386 libwebp6:i386 libwebpmux3:i386 libwind0-heimdal:i386 libwine libwine:i386 libwrap0:i386 libx11-6:i386 libx11-xcb1:i386 libx264-155 libx264-155:i386 libx265-179 libx265-179:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-randr0:i386 libxcb-render0:i386 libxcb-shm0:i386 libxcb-sync1:i386 libxcb-xfixes0:i386 libxcb1:i386 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxi6:i386 libxinerama1:i386 libxkbcommon0:i386 libxml2:i386 libxpm4:i386 libxrandr2:i386 libxrender1:i386 libxshmfence1:i386 libxslt1.1:i386 libxss1:i386 libxv1:i386 libxvidcore4 libxvidcore4:i386 libxxf86vm1:i386 libzstd1:i386 libzvbi-common libzvbi0 libzvbi0:i386 mesa-va-drivers mesa-va-drivers:i386 mesa-vdpau-drivers mesa-vdpau-drivers:i386 mesa-vulkan-drivers:i386 ocl-icd-libopencl1 ocl-icd-libopencl1:i386 va-driver-all va-driver-all:i386 vdpau-driver-all vdpau-driver-all:i386 wine zlib1g:i386
Enter “Y” and proceed with the installation. Overall it will take about 2 to 3 minutes at most.
Once completed, verify the version you have installed by typing the following command:
The output should be:
$ wine --version wine-5.0 (Ubuntu 5.0-3ubuntu1)
You have successfully installed Wine 5.0 through Ubuntu’s default repositories. If you are looking for a newer version, move onto the step below to install.
Install Wine 6.0
The following will show you how how to install Wine version 6 on Ubuntu 20.04. This is recommended more as you get a better Wine version that has more features and bug fixes.
First, download the GPG key for Wine.
sudo wget -qO- https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
You should get the output:
$ sudo wget -qO- https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add - OK
Next, you will install the WineHQ repository. To do this, enter the following commands:
sudo apt install software-properties-common \ sudo apt-add-repository "deb http://dl.winehq.org/wine-builds/ubuntu/ $(lsb_release -cs) main"
You will get a similar output:
$ sudo apt install --install-recommends winehq-stable Reading package lists… Done Building dependency tree Reading state information… Done The following additional packages will be installed: wine-stable wine-stable-amd64 wine-stable-i386:i386 The following NEW packages will be installed: wine-stable wine-stable-amd64 wine-stable-i386:i386 winehq-stable 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 159 MB of archives. After this operation, 1,093 MB of additional disk space will be used. Do you want to continue? [Y/n]
Enter “Y” to proceed. The installation should take 2 to 3 minutes as per the previous 5.0 through the APT package manager. Note, the example of the 6.0 installation may be missing the long list of required packages from the 5.0 install, which may show up on your install. This is ok.
Lastly, verify your Wine version:
You should get the following output:
$ wine --version wine-6.0.1
Note, this version number should change in time, and the output is an example only.
Finalize Wine Installation
To start Wine, run the command “winecfg” from your Ubuntu terminal. This command will proceed to install Mono and Gecko and sets the Wine environment.
Press “Install” to proceed from Mono to Gecko Installer.
Again, press the “Install” button to proceed to finish the installation off.
Once you have finished the installation, the Wine configuration dialogue will be shown. In this section of the software, you can configure various Wine settings.
The default settings should be sufficient in most cases. However, if you are going to change anything, it will be the Windows version that defaults Windows 7 to something more recently, such as Windows 10.
Once finished, close the dialogue box.
Example of using Wine to Install Windows App
In a brief example, we will use Wine to install the chat application Telegram. Note that this comes natively in Linux packages, but we will use Wine to install the Windows version on our Ubuntu 20.04 operating system for a guide purpose.
First, download the Telegram “Windows Version” .exe package.
Next, navigate to your downloads directory and right-click the .exe of the Telegram application we want to install.
Right-click the .exe, now you will see “Open With winebrowser“, click it to open the Windows application on your Ubuntu 20.04 operating system.
Next, you will see the set-up box appear for Telegram.
Select your language, then click ok.
Next, is the default installs path. As you can see, it has a default install path similar to Windows, “C:\users\bytesboss\Application Data\Telegram Desktop“. Windows applications are installed in most Linux based systems in the “~/.wine/drive_c/” directory.
Leave as default, and click next to proceed with the installation.
In the next step, you can change the folder, mostly do not touch this. The default should be fine. Optional, you can opt-out of creating a start menu folder by selecting “Don’t create a Start Menu folder“.
Click on the Next button to proceed to the next page. Once you have done this, you will get a new option to “Create a desktop shortcut“. By default, it is selected. If you do not wish this, then unselect and click Next.
Lastly, you will see an overview of the options you have selected. If you want to change anything, now is the time. If ok, click “Install” to finish the installation of Telegram.
Overall, the installation should take less than 10 seconds once done. You should see the following:
Click the “Finish” button, and launch Telegram.
Congratulations, your Wine is working correctly to install Windows applications on your Ubuntu 20.04 system.
To find Telegram in the future, you can discover Telegram, and the uninstall option in your Application Menu.
Note that you will need to have Wine installed permanently to use these programs while installed on your operating system.
Comments and Conclusion
In the guide, you have now learnt how to install Wine, including a demonstration of installing a Windows .exe application using Wine on your Ubuntu-based system. Overall, Wine is an excellent program with some real benefits combining Windows and Linux for the user.
Examples of Wine benefits over Windows:
- Wine makes it possible to take advantage of all the Unix strong points (stability, flexibility, remote administration) while still using the Windows applications you depend on.
- Unix has always made it possible to write powerful scripts. Wine makes it possible to call Windows applications from scripts that can also leverage the Unix environment to its full extent.
- Wine makes it possible to access Windows applications remotely, even if they are a few thousand miles away.
- Wine makes it economical to use thin clients: install Wine on a Linux server, and voila, you can access these Windows applications from any X terminal.
- Wine can also be used to make existing Windows applications available on the Web using VNC and its Java/HTML5 client.
- Wine is Open Source Software, so you can extend it to suit your needs or have one of many companies do it for you.
If you have questions, feel free to leave a comment below.