After switching to Ubuntu, many of you need to run your favorite windows application. Well, for that Wine is here.
To properly install wine on Ubuntu, you have to follow the steps below.
- Add i386 architecture support.
- Add extra repository if needed.
- Update the software repository.
- Find out which wine version you need.
- Install wine Ubuntu with apt.
- Configure and apply fixes to wine, if necessary.
After installing wine, you can install and run your windows apps through it, let's get started.
ContentsShow / Hide
Add 32 bit architecture support
Most windows apps depends on many many 32 bit linux shared libraries to run. In fact you can not run most windows apps on a 64 bit system without them.
Open up your favorite terminal emulator like gnome terminal and the type the commands listed below one by one.
sudo dpkg --add-architecture i386
The command will ask for your password, type it and hit Enter. Now you can verify if the command worked properly or not.
sudo dpkg --print-foreign-architectures
The above command should return
i386 , ant that's all you need to do in this step.
Add extra Wine repository
Ubuntu's default repository doesn't have the latest wine builds, so if you need a very recent wine release, then you've to use another repository.
There's three main wine repository from WineHQ, Stable branch, Development branch and Staging branch .
You need to run the commands below one by one to add the WineHQ repository.
wget -nc https://dl.winehq.org/wine-builds/Release.key sudo apt-key add Release.key sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/
Update the apt software repository
Next you need to update the repository to make the changes available, it's fairly easy.
sudo apt-get update
Here's a detailed apt tutorial, have a look for more advanced options.
Which Wine version should you use?
Lightweight windows apps runs flawlessly on any linux Wine version. But large software or games runs much better on a specific version of Wine.
So, that's a bit complicated, you've to find out the best wine version for your software. Searching the web could help you, here's the official wine apps database.
You can install and use multiple versions of wine at the same time. But be careful about dependency and conflict betwen multiple versions.
The easiest way to manage multiple wine installations is by using different
WINEPREFIX for each version. That's another big topic, I'll discus about it later.
Install wine Ubuntu with apt
You can use either Ubuntu software center or the command line to install wine, here we'll use the commands.
To install full wine use the apt command, it will install wine and all it's 32 bit dependencies.
sudo apt-get install wine1.8
However, if you need a minimal install, use the
--no-install-recommends flag with apt.
sudo apt-get --no-install-recommends install wine1.8
To install wine 2.x series from the WineHQ development branch repository, use the command below.
sudo apt-get install wine-devel
Note that wine devel branch is installed under
/opt directory and doesn't create any application menu.
Configure and apply fixes to Wine Ubuntu
You need to install some windows related libraries and frameworks to use wine properly.
/opt/wine-devel/bin/winecfg depending on your wine version.
You'll be asked to installed .NET framework, Wine Gecko or Mono framework. Next they'll be installed automatically from internet.
You may also need to choose proper windows version, like windows 7 in the wine configuration editor.
Extra - Uninstall Wine
If you think wine is no more useful, and want to uninstall, then it's here.
Again We'll use the apt command to uninstall wine from Ubuntu. Simply run the command below.
sudo apt-get purge wine wine-* sudo apt-get autoremove --purge
Finally remove the directory containing all run time data generated by wine.
rm -rf ~/.wine/ rm -rf ~/.local/share/applications/wine*
It should be a pretty clean uninstall, removed almost everything related to wine.
Now most application has their Linux alternative, so it's better to run the native linux alternative than through wine.
However for games and some application like LTspice, we have no choice, so in that case wine is necessary.
So, that's all how to install install wine in Ubuntu 16.04, 17.04, 17.10 and later versions, hope that's simple enough to understand. If you have any question or suggestion, just drop a comment.