Introduction
Wine is a free and open-source compatibility layer that allows you to run Windows applications on Linux. It is a great way to get access to Windows-only software on your Ubuntu system. In this guide, we will show you how to install Wine on Ubuntu. We will also provide some tips on how to configure Wine for optimal performance. So, let’s get started!
How to Install Wine on Ubuntu
1. Open the Terminal by pressing Ctrl+Alt+T.
2. Add the Wine repository by typing the following command:
sudo add-apt-repository ppa:wine/wine-builds
3. Update the package list by typing the following command:
sudo apt-get update
4. Install Wine by typing the following command:
sudo apt-get install –install-recommends winehq-stable
5. Once the installation is complete, you can verify the version of Wine installed by typing the following command:
wine –version
Introduction
Wine is an application that allows you to run Windows programs on a Linux system. Wine is similar to an emulator, but with a different technology that improves performance.
In this tutorial learn how to install Wine on Ubuntu.
Prerequisites
Install Wine from Ubuntu Repository
Step 1: Verify Ubuntu 32-bit or 64-bit system
Wine uses a different application for 32-bit and 64-bit versions of Ubuntu.
To view CPU details, enter the command:
lscpu
The CPU op-mode(s) field tells you which architecture you are using:
CPU op-mode(s): 32-bit: You have a 32-bit OS
CPU op-mode(s): 64-bit: You have a 64-bit OS
CPU op-mode(s): 32-bit, 64-bit: You support both
Step 2: Install Wine from Default Repositories
Installing Wine from the default Ubuntu repositories is the easiest option. However, be aware that it may not provide the latest version.
1. Start by updating the apt repository package list. This ensures the latest stable version of Wine is installed.
sudo apt update
2. To install 64-bit Wine, enter the following:
sudo apt install wine64
To install 32-bit Wine, enter the following:
sudo apt install wine32
Step 3: Verify Wine Version Installed
After the operation completes, verify the installation by checking the running version:
wine --version
Installing Wine from the official Ubuntu repository will always provide a stable install. However, the repositories may not include the latest versions.
Alternative Option: Install Wine From WineHQ Repository
If you need a more recent version of Wine, install it on Ubuntu from the developers’ repositories.
1. If you are using a 64-bit OS, start by enabling 32-bit architecture:
sudo dpkg --add-architecture i386
2. Then, update the repository again:
sudo apt update
3. Add the GPG key:
wget -qO- https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
4. Then, run the following commands to add the WineHQ repository to Ubuntu:
sudo apt install software-properties-common
sudo apt-add-repository "deb https://dl.winehq.org/wine-builds/ubuntu/ $(lsb_release -cs) main"
5. Update the package lists:
sudo apt update
6. Install the latest stable Wine release using the command:
sudo apt install --install-recommends winehq-stable
Alternatively, to install the latest development release of Wine, use the command:
sudo apt install --install-recommends winehq-devel
7. Verify the installation by running:
wine --version
Note: The apt package manager typically handles any dependencies. If you get an error that a dependency is missing during the Wine installation, install each missing dependency with the command:
sudo apt install <package_name>
Then rerun the installation command.
How to Update Wine
Wine is updated frequently. To manually update wine, use the command:
sudo apt-get upgrade winehq-stable
Replace stable
with devel
for the developer version.
Stable releases come out every 10-12 weeks. Developer updates come out much more frequently.
By default, wine creates an installation directory in the home directory. It uses a virtual c:\ drive to interpret commands. You can find this directory at /$HOME/.wine/drive_c/
.
How to Uninstall Wine From Ubuntu
To uninstall wine:
sudo apt remove wine[version]
Instead of wine[version]
, type wine64
, wine32
, wine-stable
or wine-dev
according to the version you have installed.
That command removes Wine, but not its dependencies. To remove all unnecessary dependencies, run the command:
sudo apt autoremove
Removal of these remaining folders needs to be done manually. Run the following commands:
rm -rf $HOME/.wine
rm -f $HOME/.config/menus/applications-merged/wine*
rm -rf $HOME/.local/share/applications/wine
rm -f /.local/share/desktop-directories/wine*
rm -f /.local/share/icons/????_*.xpm
After deleting the files and directories, run:
sudo apt-get remove --purge ^wine
Now to correct any installation errors, run:
sudo apt-get update
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
Wine should now be totally removed from your system.
Get Started Using Wine
To set up the configuration directory for Wine, run the following command:
wineboot
The command creates the ~/.wine directory and initializes all the components.
Launching Applications
If you’re running a GUI on Ubuntu, double-click a Windows.exe file to launch it. Wine automatically associates itself with the .exe file extension. You can also right-click the application and select Open With > Wine.
To launch an application from the command line, enter the following:
cd '/.wine/drive_c/program_folder'
wine launcher.exe
It’s essential to change the working directory to the location of the application files. Replace program_folder
with the actual directory that holds the application. Replace launcher.exe
with the executable file for the application.
wine start Command
The wine start
command is more robust than the basic wine
command. It allows Wine to handle the working directory. Use it to specify a path to a specific location:
wine start 'C:\program_location\launcher.exe'
Specify a Linux path:
wine start /unix "$HOME/program_location/installer.exe
Use the wine
or wine start
command to launch the installer for the Windows application.
To download an installer to a local directory, use wget
and then use the wine command to launch the installer. The application installs as it would on Windows. When installing from a disc, use the wine start
command to specify the path to the installer. Use this to change drives in the middle of installation, if needed.
For security, do not run wine as a root user. Doing so can allow viruses and malware to infect your system.
Conclusion
Wine is a powerful tool that allows you to run Windows programs in Linux. This guide provides a solid start for installing and running wine on Ubuntu.
If you are using a different flavor of Linux, we have this tutorial also available for CentOS 7.
How to Install Wine on Ubuntu
Wine is a free and open-source compatibility layer that allows you to run Windows applications on Linux. It is a great way to get access to Windows-only software on your Ubuntu system. In this guide, we will show you how to install Wine on Ubuntu.
Prerequisites
- A computer running Ubuntu
- An internet connection
Step 1: Update the System
Before you can install Wine, you need to make sure that your system is up to date. To do this, open a terminal window and run the following command:
sudo apt update && sudo apt upgrade -y
This will update the system and install any available updates.
Step 2: Add the Wine Repository
The next step is to add the Wine repository to your system. To do this, run the following command:
sudo add-apt-repository ppa:wine/wine-builds
This will add the Wine repository to your system.
Step 3: Install Wine
Now that the repository is added, you can install Wine. To do this, run the following command:
sudo apt install --install-recommends winehq-stable
This will install the latest version of Wine on your system.
Step 4: Verify the Installation
Once the installation is complete, you can verify that it was successful by running the following command:
wine --version
This will display the version of Wine that is installed on your system.
Conclusion
In this guide, we showed you how to install Wine on Ubuntu. Wine is a great way to get access to Windows-only software on your Ubuntu system. Now that you have Wine installed, you can start using Windows applications on your Ubuntu system.