Wine is a free and open-source compatibility layer that allows you to run Microsoft Windows applications on Unix-like operating systems such as Linux. It is originally an acronym for “Wine Is Not an Emulator”
1.Verify the installed architecture of your system.
For 64-bit:
dpkg –print-architecture
Sample Output:
tux@FreeLinux:~$ dpkg –print-architecture
amd64
For 32-bit:
dpkg –print-foreign-architectures
Sample Output:
tux@FreeLinux:~$ dpkg –print-foreign-architectures
i386
Note: If system is a 64-bit, enable the 32 bit architecture using this command:
sudo dpkg –add-architecture i386
2.Download repository key
wget -nc https://dl.winehq.org/wine-builds/winehq.key
Sample Output:
tux@FreeLinux:~$ wget -nc https://dl.winehq.org/wine-builds/winehq.key–2021-07-17 13:24:57– https://dl.winehq.org/wine-builds/winehq.key
Resolving dl.winehq.org (dl.winehq.org)… 199.232.46.217
Connecting to dl.winehq.org (dl.winehq.org)|199.232.46.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
2021-07-17 13:24:57 (48.5 MB/s) – ‘winehq.key’ saved [3220/3220]
3.Install repository key
sudo gpg -o /etc/apt/trusted.gpg.d/winehq.key.gpg –dearmor winehq.key
Sample Output:
tux@FreeLinux:~$ sudo gpg -o /etc/apt/trusted.gpg.d/winehq.key.gpg –dearmor winehq.key
[sudo] password for tux:
4. Add repository key
sudo add-apt-repository ‘deb https://dl.winehq.org/wine-builds/ubuntu/ focal main’
Depending on your version
Ubuntu 21.04:
sudo add-apt-repository ‘deb https://dl.winehq.org/wine-builds/ubuntu/ hirsute main’
Ubuntu 20.10:
sudo add-apt-repository ‘deb https://dl.winehq.org/wine-builds/ubuntu/ groovy main’
Ubuntu 18.04:
sudo add-apt-repository ‘deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main’
Since I’m using Ubuntu 20.04, here’s the sample output:
tux@FreeLinux:~$ sudo add-apt-repository ‘deb https://dl.winehq.org/wine-builds/ubuntu/ focal main’
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Get:2 https://dl.winehq.org/wine-builds/ubuntu focal InRelease [6,257 B]
Get:3 https://dl.winehq.org/wine-builds/ubuntu focal/main amd64 Packages [227 kB]
Fetched 1,506 kB in 3s (452 kB/s)
Reading package lists… Done
5. Update the package
sudo apt update
6. Install Wine package
Stable branch:
sudo apt install –install-recommends winehq-stable
Development branch:
sudo apt install –install-recommends winehq-devel
Staging branch:
sudo apt install –install-recommends winehq-staging
Sample Output:
tux@FreeLinux:~$ sudo apt install –install-recommends winehq-stable
Reading package lists… Done
Building dependency tree
Reading state information… Done
After this operation, 1,426 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up wine-stable-i386:i386 (6.0.1~focal-1) …
Setting up wine-stable (6.0.1~focal-1) …
Setting up winehq-stable (6.0.1~focal-1) …
Processing triggers for libc-bin (2.31-0ubuntu9.2) …
Processing triggers for libgdk-pixbuf2.0-0:i386 (2.40.0+dfsg-3ubuntu0.2) …
7.Verify installation
wine –version
Sample Output:
tux@FreeLinux:~$ wine –version
wine-6.0.1
8.Test by installing and running “Windows” program
Example: Notepad++
a. Download via the website or command line
wget https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.1.1/npp.8.1.1.Installer.x64.exe
b. Right click the .exe file and select for “Wine Windows Program Loader”
c. Install as per normal via its wizard
c. Run the program