When Linux was originally made public, it lacked many useful applications that the major competitor -Microsoft Windows was successfully running. Linux thus created a compatibility layer, called Wine, through which you can run the Windows applications on Linux itself. Initially, Wine could only run a few Windows applications but now it can support thousands of them; making it a very powerful Linux application.
In this article, we will describe how to install and use Wine on Ubuntu in order to install Windows applications. We have run the commands and procedures mentioned in this article on a Ubuntu 18.04 LTS system.
Wine Installation on Ubuntu
The WineHQ repository has a set of standard Wine packages that you can download and install on your system. Please follow these steps to do so:
1. Run the following command in the Terminal for adding i386 architecture before installing a 64-bit version of Wine:
$ sudo dpkg --add-architecture i386
2. Run the following in order to add the WineHQ signing key:
$ wget -qO- https://dl.winehq.org/wine-builds/Release.key | sudo apt-key add -
Tip: You can copy this command from this tutorial instead of typing it in the Terminal. Select and copy this command from here, right-click in the Terminal prompt and then select Paste from the menu. You can also use the Ctrl+Shift+V shortcut in order to paste the copied text.
3. Now run the following command in order to add the relevant repository from the WineHQ:
$ sudo apt-add-repository 'deb http://dl.winehq.org/wine-builds/ubuntu/ artful main'
4. Here you have two options about which release of Wine you want to install; the stable version or the development versions.
- WineHQ Stable: This is the most recent and stable release of Wine available. Use the following command to install this version:
$ sudo apt-get install --install-recommends winehq-stable
Please enter Y when prompted with a choice of y/n for installation. After that, the stable version of Wine will be installed on your system.
- WineHQ Development: This is the most recent version of Wine but it might not be very stable. As a developer, you might be more interested in installing this version.
$ sudo apt-get install --install-recommends winehq-devel
Please enter Y when prompted with a choice of Y/n for installation. After that, the development version of Wine will be installed on your system. The process may take some time depending on your Internet speed.
5. In order to verify installation and checking which version is installed on your system, run the following command:
$ wine --version
Look up for your required Windows application
It is important to keep the latest version of Wine installed on your system because Wine developers are always working on adding support for more and more Windows applications. The official Wine website maintains a list of all the applications currently supported by Wine. Here is the link to the website:
You can browse through the list of supported applications and view how well they would run on Wine. This is indicated by the Rating value which can vary from Platinum(best), Gold, Silver, Bronze, to Garbage(won’t run on Wine). Moreover, you can also view which version of Wine was the applications tested on.
On the WineHQ website, look up for the Browse Apps link located on the left side of the page.
In this Example, I am searching for Notepad++ by entering the keywords in the Name filter. The search results display my required application as follows?
From here I can click the relevant search result to view all the versions of the searched software supported by Wine.
The description, latest rating, latest Wine version tested, test results and the comments on a version can help you in deciding which version of the software you want to install.
When you click on a Version number, you will get an even more detailed page about the application.
I would click Version 7.x as it best suits my needs, based on the rating and latest wine version tested.
Download and Use a Windows Application with Wine
The above page gives a URL from where I can freely download the required version of Notepad++.
I have chosen to download a 7z download package. The download package will be saved to your Downloads folder by default. From there you can right-click the 7z file and select “Extract here” from the menu.
These are the contents of the extracted folder:
Right-click the notepad++.exe file and you will be able to see the “Open With Wine Windows Program Loader” option as follows:
Select this option and you will be able to view and use the Notepad++ application as follows:
In case you want to uninstall Wine from your system, run the following command in your Ubuntu Terminal:
$ sudo apt-get purge winehq-stable
You will also need to run the following commands to completely remove the installation and relevant folders:
1. rm ~/.config/wine/ -rf 2. rm -rf $HOME/.wine 3. rm -f $HOME/.config/menus/applications-merged/wine* 4. rm -rf $HOME/.local/share/applications/wine 5. rm -f $HOME/.local/share/desktop-directories/wine* 6. rm -f $HOME/.local/share/icons/????_*.xpm
By following the same procedure described in this article to use Notepad++, you can download and use any other Wine supported Windows application that otherwise seemed impossible to run on Ubuntu.