Difference between revisions of "Ubuntu"

From WineHQ Wiki
Jump to: navigation, search
(→‎Installing WineHQ packages: A temporary section about the GPG error some users get.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
__NOTOC__
 
 
'''Translations of this page:'''  {{flag|China}} [[Ubuntu_zhcn|简体中文]] {{flag|Netherlands}} [[Ubuntu_nl|Nederlands]]
 
'''Translations of this page:'''  {{flag|China}} [[Ubuntu_zhcn|简体中文]] {{flag|Netherlands}} [[Ubuntu_nl|Nederlands]]
== Installing WineHQ packages ==
+
<!--
{{warning}}''' The WineHQ repository key was changed on 2018-12-19.''' If you downloaded and added the key before that time, you will need to download and add the new key and run sudo apt update to accept the repository changes.
+
This page is used to load the variable "Ubuntu" into the WineHQ_Repository page.
 
+
Link to this page and _not_ to the WineHQ_Repository page!
{{warning}}''' Ubuntu 18.04/Linux Mint 19.x do not provide FAudio, which is a dependency of Wine versions prior to 6.21. Users of the current wine-stable packages will need to install this. Follow the instructions in https://forum.winehq.org/viewtopic.php?f=8&t=32192 to install FAudio from the OBS.''' (FAudio packages for Ubuntu 19.10 and later are in the distro's universe repository.)
+
-->
 
+
{{:WineHQ_Repository|Ubuntu|ubuntu}}
{{warning}}''' Apt-key is now deprecated. '''
 
If you get a warning about this, remove the key with:</br>
 
<code>sudo apt-key del "D43F 6401 4536 9C51 D786  DDEA 76F1 A20F F987 672F"</code></br>
 
And remove the the line about the WineHQ repository from <tt>/etc/apt/sources.list</tt>.
 
 
 
{{warning}}''' Ubuntu 22.04: "Unable to locate package winehq-stable" '''
 
There are no stable packages for Ubuntu 22.04 yet because Jammy Jellyfish did not exist when Wine 7.0 came out. There will be stable packages whenever 7.0.1 comes out.
 
 
 
{{info}} '''<nowiki>W: GPG error: https://dl.winehq.org/ ... NO_PUBKEY 76F1A20FF987672F</nowiki>'''</br>
 
Currently, the Wine servers are being synchronized. This means that some users are already getting the new .sources file.
 
If you get this warning, move the ''winehq-archive.key'' file from ''/usr/share/keyrings/'' to ''/etc/apt/keyrings/''. For example:</br>
 
<code>sudo mkdir -pm755 /etc/apt/keyrings</code></br>
 
<code>sudo mv /usr/share/keyrings/winehq-archive.key /etc/apt/keyrings/winehq-archive.key</code>
 
 
 
----
 
 
 
If you have previously installed a Wine package from another repository, please remove it and any packages that depend on it (e.g., wine-mono, wine-gecko, winetricks) before attempting to install the WineHQ packages, as they may cause dependency conflicts.
 
 
 
If your system is 64 bit, enable 32 bit architecture (if you haven't already):
 
 
 
sudo dpkg --add-architecture i386
 
 
 
Download and add the repository key:
 
sudo wget -nc -O /usr/share/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
 
 
 
Add the repository:
 
{|  style="width: 100%" class="wikitable"
 
!For this version:
 
!Use this command:
 
|-
 
|Ubuntu 22.04 (Jammy Jellyfish)
 
Linux Mint 21.x
 
|
 
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
 
|-
 
|Ubuntu 20.04 (Focal Fossa)
 
Linux Mint 20.x
 
|
 
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/focal/winehq-focal.sources
 
|-
 
|Ubuntu 18.04 (Bionic Beaver)
 
Linux Mint 19.x
 
|
 
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/winehq-bionic.sources
 
|}
 
 
 
Update packages:
 
 
 
sudo apt update
 
 
 
Then install '''one of the following packages''':
 
 
 
{|  style="width: 100%" class="wikitable"
 
! 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
 
|}
 
If apt complains about missing dependencies, install them, then repeat the last two steps (update and install). See [[FAQ#How_do_I_solve_dependency_errors_when_trying_to_install_Wine.3F|the FAQ entry on dependency errors]] for tips on troubleshooting dependency issues.
 
 
 
----
 
 
 
====If you have previously used the distro packages, you will notice some differences in the WineHQ ones:====
 
 
 
* Files are installed to /opt/wine-devel, opt/wine-stable, or /opt/wine-staging (depending on which version you installed).
 
 
 
* Menu items are not created for Wine's builtin programs (winecfg, etc.), and if you are upgrading from a distro package that had added them, they will be removed. You can recreate them yourself using your menu editor.
 
 
 
* Binfmt_misc registration is not added. Consult your distro's documentation for [http://manpages.ubuntu.com/manpages/jaunty/man8/update-binfmts.8.html update-binfmts] if you wish to do this manually.
 
 
 
* WineHQ does not at present package wine-gecko or wine-mono. When creating a new wine prefix, you will be asked if you want to download those components. For best compatibility, it is recommended to click Yes here. If the download doesn't work for you, please follow the instructions on the [http://wiki.winehq.org/Gecko Gecko] and [http://wiki.winehq.org/Mono Mono] wiki pages to install them manually.
 
 
 
* Beginning with Wine 5.7, the WineHQ Ubuntu packages have an optional debconf setting to enable CAP_NET_RAW to allow applications that need to send and receive raw IP packets to do so. This is disabled by default because it carries a potential security risk, and the vast majority of applications do not need that capability. Users of applications that do need it can enable CAP_NET_RAW after installing Wine by running
 
dpkg-reconfigure wine-<branch>-amd64 wine-<branch> wine-<branch>-i386
 
and answering yes to the three questions. (Substitute devel, staging, or stable for <branch> in the above command.)
 
 
 
 
----
 
 
 
== Installing without Internet ==
 
To install Wine on an Ubuntu machine without internet access, you must have access to a second Ubuntu machine (or VM) with an internet connection to download the Wine .deb package and its dependencies.
 
 
 
On the machine with internet, add the WineHQ repository and run apt update as described above.
 
 
 
Next, cache just the packages necessary for installing wine, without extracting them:
 
 
 
sudo apt-get clean
 
sudo apt-get --download-only install winehq-devel
 
sudo apt-get --download-only dist-upgrade
 
 
 
Copy all of the .deb files in /var/cache/apt/archives to a USB stick:
 
 
 
cp -R /var/cache/apt/archives/ /media/usb-drive/deb-pkgs/
 
 
 
Finally, on the machine without internet, install all of the packages from the flash drive:
 
 
 
cd /media/usb-drive/deb-pkgs
 
sudo dpkg -i *.deb
 
 
 
The same instructions can also be used for an offline installation of the `winehq-staging` packages.
 
 
 
== Compiling WoW64 ==
 
Ubuntu's implementation of [[Multiarch]] is still incomplete, so for now you can't simply install 32-bit and 64-bit libraries alongside each other. If you're on a 64-bit system, you'll have to create an isolated environment for installing and building with 32-bit dependencies. See [[Building Biarch Wine On Ubuntu]] for detailed instructions for Ubuntu using LXC, and [[Building Wine]] for general information.
 
 
 
== See Also ==
 
* [https://dl.winehq.org/wine-builds/ubuntu/pool/main/ Official WineHQ packages].
 
* [https://build.opensuse.org/project/show/Emulators:Wine:Debian WineHQ Debian/Ubuntu package build scripts and logs]
 
* [[Building Biarch Wine On Ubuntu]]
 
* [[Building Wine]]
 
* [[Packaging]]
 
* [[Multiarch]] in Wine build dependencies
 
  
 
----
 
----
 
[[Category:Distributions]]
 
[[Category:Distributions]]

Latest revision as of 07:30, 19 September 2022

Translations of this page: Flag of the People's Republic of China.svg 简体中文 Flag of the Netherlands.svg Nederlands


WineHQ Packages

Icon-distro-ubuntu.png Although Ubuntu offers its own Wine packages, these are often several versions behind.

To make installing the latest version of Wine as easy as possible, WineHQ has its own Ubuntu repository. Should a newer version of Wine give problems, it is also possible to install an older version of your choice.

Preparation

If your system is 64 bit, enable 32 bit architecture (if you haven't already):

sudo dpkg --add-architecture i386 

Add the repository

Download and add the repository key:

sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key

Select your Ubuntu version and download the WineHQ sources file:

Ubuntu 22.10

(Kinetic Kudu)

sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/kinetic/winehq-kinetic.sources
Ubuntu 22.04

(Jammy Jellyfish)

Linux Mint 21.x

sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
Ubuntu 20.04

(Focal Fossa)

Linux Mint 20.x

sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/focal/winehq-focal.sources
Ubuntu 18.04

(Bionic Beaver)

Linux Mint 19.x

sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/winehq-bionic.sources

Update the package information:

sudo apt update

Install Wine

Install one of the following packages:

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

The WineHQ Wiki explains the differences between the branches.

Help

Sometimes there are problems installing Wine. If your problem is not listed, search the forum or if you can't find an answer ask your question.

Missing dependencies

Read the FAQ about dependency errors and tips for troubleshooting dependency issues. The most common issues are:

Third-party repositories

WineHQ packages are created and tested for a clean Ubuntu installation. Using PPAs or third-party repositories may prevent the installation of Wine. Often the problem is that these repositories are not multiarch. The required 32 and 64-bit packages are missing or cannot be installed side by side. The deb.sury.org repository is known for causing problems.

Downgrade the problematic dependency packages to the official Ubuntu version.

KDE Neon

Ubuntu 22.04 KDE Neon users report problems with the libpoppler-glib8 dependency. The solution is to downgrade this package to the official Ubuntu version. sudo apt install libpoppler-glib8:{i386,amd64}=22.02.0-2ubuntu0.1

Backports

Another cause may be the use of backports. A newer 64-bit version of a library is already installed, but the 32-bit version isn't. These packages are given a lower priority so they will not be installed automatically. The solution is to manually install the missing 32-bit package from backports.

FAudio

Older versions of Wine (prior to version 6.21) have FAudio as a dependency. These packages are missing on Ubuntu 18.04. These can be downloaded from the Open Build Service. For Debian 10, these packages are available in backports.

Winehq key problems

  • W: GPG error: https://dl.winehq.org/ ... NO_PUBKEY 76F1A20FF987672F

Currently, the Wine servers are being synchronized. This means that some users still getting the older .sources file. If you get this warning, edit the winehq-<distro>.sources file and replace /usr/share/keyrings/ to /etc/apt/keyrings/.

For example: sudo sed -i s@/usr/share/keyrings/@/etc/apt/keyrings/@ /etc/apt/sources.list.d/winehq-focal.sources

  • The WineHQ repository key was changed on 2018-12-19

If you downloaded and added the key before that time, you will need to download and add the new key and run sudo apt update to accept the repository changes.

  • Apt-key is now deprecated

Previously, apt-key was used to add the Wine key. If you get this warning, remove the Wine key with: sudo apt-key del "D43F 6401 4536 9C51 D786 DDEA 76F1 A20F F987 672F" And remove the the line about the WineHQ repository from /etc/apt/sources.list(.d/*).

Mirror sync in progress?

If you get an error message when trying to install a package from WineHQ that includes the line Mirror sync in progress? that is most likely the problem. There are many packages to sync, and it can take a long time to complete.

Wait a few hours, and try again. If the problem persists for more than a day, file a bug.

My Ubuntu version is not listed

When a version of Ubuntu is no longer supported, no new Wine packages are made. Check the WineHQ server to see if there are older packages are available. Because no new versions are made, adding the WineHQ repository is not necessary. Downloading and installing the four WineHQ deb packages is sufficient.

Please note that these packages are no longer maintained and are no longer supported.

Notes

  • Menu items are not created for Wine's builtin programs (winecfg, etc.). If you upgrade the Wine distro packages that had added them, they will be removed. You can recreate them yourself using your menu editor.
  • The Wine files are installed in /opt/wine-<branch>/
  • WineHQ does not offer wine-gecko or wine-mono packages. When creating a new wineprefix, you will be asked if you want to download those components. For best compatibility, it is recommended to click Yes here. If the download doesn't work for you, please follow the instructions on the Gecko and Mono wiki pages to install them manually.
  • Beginning with Wine 5.7, the WineHQ packages have an optional debconf setting to enable CAP_NET_RAW to allow applications that need to send and receive raw IP packets to do so. This is disabled by default because it carries a potential security risk, and the vast majority of applications do not need that capability. Users of applications that do need it can enable CAP_NET_RAW after installing Wine by running dpkg-reconfigure wine-<branch>-amd64 wine-<branch> wine-<branch>-i386 and answering yes to the three questions.
  • Binfmt_misc registration is not added. Consult your distro's documentation for update-binfmts (man update-binfmts) if you wish to do this manually.
  • A complete Wine installation on a 64-bit system consists of four packages.
winehq-<branch> This package ensures that the wine command is available system-wide.
wine-<branch> This package has the following two packages as dependencies and provides a working Wine installation.
wine-<branch>-amd64 The 64-bit part of Wine.
wine-<branch>-i386 The 32-bit part of Wine.
By splitting a Wine over different packages, it is possible to install different branches side by side.
For example: Use Wine stable as the default Wine version and install Wine staging to test other programs.
Install Wine stable:
sudo apt install --install-recommends winehq-stable
Install Wine staging:
sudo apt install --install-recommends wine-staging (Note the missing hq after wine)
Run a program with Wine stable:
wine program.exe
Run a program with Wine staging:
WINEPREFIX=~/wine-staging /opt/wine-staging/bin/wine program.exe
(It is recommended to give each Wine branch its own wineprefix.)
  • There are several versions of Wine on the repository. The latest version is installed by default. Usually, the latest version is recommended. However, it may happen that an older version is desired. Use apt policy winehq-<branch> to list the different available versions.
Install an older version of your choice with sudo apt install winehq-<branch>=<version>
For example:
sudo apt install winehq-staging=7.12~bookworm-1
When the Wine packages are downgraded, all four Wine packages must be downgraded.
sudo apt install winehq-staging=7.12~bookworm-1 wine-staging=7.12~bookworm-1 wine-staging-amd64=7.12~bookworm-1 wine-staging-i386=7.12~bookworm-1

Installing without Internet

To install Wine on a Ubuntu machine without internet access, you must have access to a second Ubuntu machine (or VM) with an internet connection to download the WineHQ .deb package and its dependencies.

On the machine with internet, add the WineHQ repository and run apt update as described above.

Next, cache just the packages necessary for installing Wine, without extracting them:

sudo apt-get clean

sudo apt-get --download-only install winehq-<branch>

sudo apt-get --download-only dist-upgrade

Copy all of the .deb files in /var/cache/apt/archives to a USB stick:

cp -R /var/cache/apt/archives/ /media/usb-drive/deb-pkgs/

Finally, on the machine without internet, install all of the packages from the flash drive:

cd /media/usb-drive/deb-pkgs sudo dpkg -i *.deb

Building from Source

  • Beginning with 4.0-rc2, the WineHQ repository includes the .dsc, .diff.gz, and .orig.tar.gz files generated by the Open Build Service(OBS). These source packages can be found on "https://dl.winehq.org/wine-builds/ubuntu/dists/<version>/main/source"
  • The latest version of Ubuntu is multiarch. It is possible to install all 64 and 32 bit dependencies side by side. This allows Wine to be built using the steps listed under Shared WoW64.
  • On older versions of Ubuntu the multiarch implementation could be incomplete. You can't simply install 32-bit and 64-bit libraries alongside each other. If you're on a 64-bit system, you'll have to create an isolated environment for installing and building with 32-bit dependencies. See Building Wine for instructions on how to build in a chroot or container.

See Also