can't install wine on ubuntu 20.04 focal

Questions about Wine on Linux
Post Reply
raphael75
Level 1
Level 1
Posts: 9
Joined: Mon Apr 20, 2020 1:32 pm

can't install wine on ubuntu 20.04 focal

Post by raphael75 » Thu Jun 23, 2022 6:50 am

I have ubuntu 20.04 focal:

Code: Select all

$ lsb_release -a
LSB Version:    core-11.1.0ubuntu2-noarch:printing-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:        20.04
Codename:       focal
I had wine 7.0 installed, but I had to install some libpcre2 packages that broke wine. I was trying to reinstall wine using the instructions here (https://wiki.winehq.org/Ubuntu) , but now I get this error:

Code: Select all

$ sudo apt-get install --install-recommends winehq-stable
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 winehq-stable : Depends: wine-stable (= 7.0.0.0~focal-1)
E: Unable to correct problems, you have held broken packages.
If I try to install wine-stable, I get this:

Code: Select all

$ sudo apt-get install wine-stable
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 wine-stable : Depends: wine-stable-i386 (= 7.0.0.0~focal-1)
E: Unable to correct problems, you have held broken packages.
Then I get:

Code: Select all

The following packages have unmet dependencies:
 wine-stable-i386:i386 : Depends: libglib2.0-0:i386 (>= 2.12.0) but it is not going to be installed
                         Depends: libgphoto2-6:i386 (>= 2.5.10) but it is not going to be installed
                         Depends: libgstreamer-plugins-base1.0-0:i386 (>= 1.0.0) but it is not going to be installed
                         Depends: libgstreamer1.0-0:i386 (>= 1.4.0) but it is not going to be installed
                         Depends: libsane:i386 (>= 1.0.24) but it is not going to be installed
                         Recommends: libodbc1:i386 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
and it cascades down until I eventually get to the point where there is a huge list of conflicting dependencies that give all kinds of errors. I don't know how to revert to the state before when wine was working. How can I get it there if all these packages say "but it is not going to be installed"?

I have these lines in my sources.list:

Code: Select all

$ cat /etc/apt/sources.list | grep wine
deb https://dl.winehq.org/wine-builds/ubuntu/ focal main
# deb-src https://dl.winehq.org/wine-builds/ubuntu/ focal main
I tried to uninstall the libpcre2 packages to see if that would let me reinstall wine, but I got this list of errors:

https://pastebin.com/qkFdLxwX

I'm not sure why it's saying packages aren't going "to be" installed, when I told it to remove them.

Also, I'm not sure if this matters, but I'm using KDE Plasma.

jkfloris
Level 12
Level 12
Posts: 2141
Joined: Thu Aug 14, 2014 10:10 am

Re: can't install wine on ubuntu 20.04 focal

Post by jkfloris » Fri Jun 24, 2022 3:48 am

The deb.sury.org repository isn't multiarch.
Replace the packages from deb.sury.org with Ubuntu's variant.

Code: Select all

# List all installed deb.sury.org packages
dpkg -l | grep deb.sury.org

# For each package find the Ubuntu version number
apt policy <package>

# Install Ubuntu's package
sudo apt install <package>=<version number>

raphael75
Level 1
Level 1
Posts: 9
Joined: Mon Apr 20, 2020 1:32 pm

Re: can't install wine on ubuntu 20.04 focal

Post by raphael75 » Fri Jun 24, 2022 7:36 am

jkfloris wrote:
Fri Jun 24, 2022 3:48 am
The deb.sury.org repository isn't multiarch.
Replace the packages from deb.sury.org with Ubuntu's variant.

Code: Select all

# List all installed deb.sury.org packages
dpkg -l | grep deb.sury.org

# For each package find the Ubuntu version number
apt policy <package>

# Install Ubuntu's package
sudo apt install <package>=<version number>
Thanks for your reply! I show this for the first one (libnginx-mod-brotli):

Code: Select all

$ sudo apt policy libnginx-mod-brotli
libnginx-mod-brotli:
  [b]Installed[/b]: 1.21.6-1+ubuntu20.04.1+deb.sury.org+2
  Candidate: 1.21.6-1+ubuntu20.04.1+deb.sury.org+2
  Version table:
 *** 1.21.6-1+ubuntu20.04.1+deb.sury.org+2 500
        [b]500[/b] http://ppa.launchpad.net/ondrej/nginx-mainline/ubuntu focal/main amd64 Packages
        [b]100[/b] /var/lib/dpkg/status

Code: Select all

$ sudo apt list --installed libnginx-mod-brotli
Listing... Done
libnginx-mod-brotli/focal,now 1.21.6-1+ubuntu20.04.1+deb.sury.org+2 amd64 [installed,automatic]

Code: Select all

$ sudo apt-cache search libnginx-mod-brotli
libnginx-mod-brotli - Brotli lossless compression support for Nginx
It looks like there is only 1 version available?

Code: Select all

$ sudo apt-cache madison libnginx-mod-brotli
libnginx-mod-brotli | 1.21.6-1+ubuntu20.04.1+deb.sury.org+2 | http://ppa.launchpad.net/ondrej/nginx-mainline/ubuntu focal/main amd64 Packages
Using your instructions, would I have both the deb.sury.org version and the official Ubuntu one, or can you only have one of them?

Also, more importantly, if I had both versions, or only had the official one, would that possibly break the version of nginx that I have installed?

Thanks!

jkfloris
Level 12
Level 12
Posts: 2141
Joined: Thu Aug 14, 2014 10:10 am

Re: can't install wine on ubuntu 20.04 focal

Post by jkfloris » Fri Jun 24, 2022 8:03 am

You're right. The deb.sury.org repository will also contain packages that are not in Ubuntu.
You may be lucky and can skip the nginx packages. I suspect the problem is with the *pcre* packages.

mivanchev
Level 2
Level 2
Posts: 12
Joined: Sat Jun 25, 2022 5:13 am

Re: can't install wine on ubuntu 20.04 focal

Post by mivanchev » Sat Jun 25, 2022 5:19 am

If you're battling dependency issues and can't resolve them you might wanna try static-wine32.

Post Reply