The other way to solve this issue is to force install the specific versions you need to get in order to satisfy dependencies (I should have suggested that first, but its more complicated to explain, and I actually didn’t think of it at the time).
The problem is that Apt likes to install the latest stuff, and it doesn’t like to downgrade to the point that it often will prevent you installing something if doing so will require something else to be downgraded. You need to tell Apt what versions you need specifically installed, when it complains it can’t install something because the version required is different than the version it thinks you want installed.
To demonstrate, I installed the Debian Pipewire PPA and tried to get my system broken to the same degree (BTW - the Debian Pipewire PPA requires installing ppa-purge
- which I didn’t had needed before hand - I wonder what do they know that we don’t…):
$ sudo apt-add-repository ppa:pipewire-debian/pipewire-upstream
$ sudo apt full-upgrade -y
$ sudo rm -f /etc/apt/sources.list.d/pipewire-debian-ubuntu-pipewire-upstream-jammy.list
$ sudo apt update
I can see that the update upgraded these packages:
gstreamer1.0-pipewire libfreeaptx0 liblc3-0 libpipewire-0.3-0 libpipewire-0.3-dev
libpipewire-0.3-modules libspa-0.2-bluetooth libspa-0.2-dev libspa-0.2-jack
libspa-0.2-modules opera-stable pipewire pipewire-bin pipewire-pulse
After removing the the PPA and updating the package database, I can check what versions Apt thinks it has available by using apt policy
. For example:
$ apt policy pipewire-pulse
pipewire-pulse:
Installed: 0.3.78-1~ubuntu22.04
Candidate: 0.3.78-1~ubuntu22.04
Version table:
*** 0.3.78-1~ubuntu22.04 100
100 /var/lib/dpkg/status
0.3.48-1ubuntu3 500
500 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages
0.3.48-1ubuntu1 500
500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
You can see that the 0.3.78-1~ubuntu22.04
version is installed, but it doesn’t have a corresponding repository - it’s “coming from the local system” (the /var/lib/dpkg/status
line). The “100” means priority - I think - where 100 is “higher priority” then 500, so Apt will prefer to keep installed packages installed.
You can then ask Apt to install the correct version:
$ sudo apt install pipewire-pulse=0.3.48-1ubuntu3
Reading package lists... Done
Building dependency tree... Done
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:
pipewire-pulse : Depends: pipewire (= 0.3.48-1ubuntu3) but 0.3.78-1~ubuntu22.04 is to be installed
E: Unable to correct problems, you have held broken packages.
It did not like that - because even though the dependency for pipewire-pulse=0.3.48-1ubuntu3
- the package pipewire
at version 0.3.48-1ubuntu3
- is available in the repository, it is of lesser priority than the version you have installed - so we need to force that one as well. Just copy the name of the dependency Apt reports, and the version requirement and put them at the end of the previous install line using the same format (mind those spaces!):
$ sudo apt install pipewire-pulse=0.3.48-1ubuntu3 pipewire=0.3.48-1ubuntu3
...
The following packages have unmet dependencies:
pipewire : Depends: libpipewire-0.3-modules (= 0.3.48-1ubuntu3) but 0.3.78-1~ubuntu22.04 is to be installed
Depends: pipewire-bin (= 0.3.48-1ubuntu3)
E: Unable to correct problems, you have held broken packages.
More complaints. That’s OK - lather, rinse, repeat until your hair is clean… uhmm… until Apt is happy…
$ sudo apt install pipewire-pulse=0.3.48-1ubuntu3 pipewire=0.3.48-1ubuntu3 libpipewire-0.3-modules=0.3.48-1ubuntu3 pipewire-bin=0.3.48-1ubuntu3 libpipewire-0.3-0=0.3.48-1ubuntu3 libpipewire-0.3-0=0.3.48-1ubuntu3 libspa-0.2-modules=0.3.48-1ubuntu3
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libconfig++9v5 libfdk-aac2 libffado2 liblc3-0 liblc3-1 libldacbt-abr2 libmujs2 libopenfec libroc libsixel1 libspa-0.2-dev libxml++2.6-2v5
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
pipewire-media-session
Recommended packages:
pipewire
The following packages will be REMOVED:
gstreamer1.0-pipewire libkpipewire-dev libpipewire-0.3-dev libspa-0.2-bluetooth libspa-0.2-jack libwireplumber-0.4-0 mpv wireplumber
The following NEW packages will be installed:
pipewire-media-session
The following packages will be DOWNGRADED:
libpipewire-0.3-0 libpipewire-0.3-modules libspa-0.2-modules pipewire pipewire-bin pipewire-pulse
0 upgraded, 1 newly installed, 6 downgraded, 8 to remove and 5 not upgraded.
Need to get 1,809 kB of archives.
After this operation, 8,255 kB disk space will be freed.
Do you want to continue? [Y/n]
Oh oh!!
Apt now wants to remove packages that I think I need! gstreamer1.0-pipewire
, mpv
and some dev packages that I may want. So - stop! don’t make the changes, and lets investigate further. Can we get a version of gstreamer1.0-pipewire
that Apt will be happy to keep?
$ apt policy gstreamer1.0-pipewire
gstreamer1.0-pipewire:
Installed: 0.3.78-1~ubuntu22.04
Candidate: 0.3.78-1~ubuntu22.04
Version table:
*** 0.3.78-1~ubuntu22.04 100
100 /var/lib/dpkg/status
0.3.48-1ubuntu3 500
500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
0.3.48-1ubuntu1 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
Well - same problem: the version we have installed is unsupported by a known repository and all the others have low priority. Nothing else seems to require it on my system (YMMV) so Apt suggest to just remove it - which is definitely something I’m opposed to. So - let’s go ahead and tell Apt to downgrade those packages as well (you’d need to actually go and run apt policy
on each to figure out the correct version numbers). You’ll need to pay attention to possible “gotchas” - for example in my case Apt threatens to remove libkpipewire-dev
, but that is actually using the correct version (the latest Neon Jammy in my case) and I don’t want to downgrade it (or uninstall). By adding that package name, with the specific version it already is installed with, to the Apt install
command, I can see that it actually has a problem with libpipewire-0.3-dev
:
The following packages have unmet dependencies:
libkpipewire-dev : Depends: libpipewire-0.3-dev but it is not going to be installed
Which was actually listed immediately after in the “packages to remove” line, so I would have gotten to it eventually, but paying attention to details is important.
Eventually, after a lot of back and forth with failing or stopping apt install
and judicious use of apt policy
, we get to this:
$ sudo apt install pipewire-pulse=0.3.48-1ubuntu3 pipewire=0.3.48-1ubuntu3 libpipewire-0.3-modules=0.3.48-1ubuntu3 pipewire-bin=0.3.48-1ubuntu3 libpipewire-0.3-0=0.3.48-1ubuntu3 libpipewire-0.3-0=0.3.48-1ubuntu3 libspa-0.2-modules=0.3.48-1ubuntu3 gstreamer1.0-pipewire=0.3.48-1ubuntu3 mpv=0.34.1-1ubuntu3 libkpipewire-dev=5.27.7-0xneon+22.04+jammy+release+build19 libpipewire-0.3-dev=0.3.48-1ubuntu3 libspa-0.2-dev=0.3.48-1ubuntu3 libspa-0.2-bluetooth=0.3.48-1ubuntu3 libspa-0.2-jack=0.3.48-1ubuntu3 libwireplumber-0.4-0=0.4.8-4 wireplumber=0.4.8-4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libkpipewire-dev is already the newest version (5.27.7-0xneon+22.04+jammy+release+build19).
The following packages were automatically installed and are no longer required:
libconfig++9v5 libfdk-aac2 libffado2 liblc3-0 liblc3-1 libmujs2 libopenfec libroc libxml++2.6-2v5
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libmujs1 libplacebo192
Suggested packages:
pipewire-doc libcuda1
Recommended packages:
pipewire
The following NEW packages will be installed:
libmujs1 libplacebo192
The following packages will be DOWNGRADED:
gstreamer1.0-pipewire libpipewire-0.3-0 libpipewire-0.3-dev libpipewire-0.3-modules libspa-0.2-bluetooth libspa-0.2-dev libspa-0.2-jack libspa-0.2-modules libwireplumber-0.4-0 mpv pipewire pipewire-bin pipewire-pulse wireplumber
0 upgraded, 2 newly installed, 14 downgraded, 0 to remove and 5 not upgraded.
Need to get 6,024 kB of archives.
After this operation, 4,895 kB of additional disk space will be used.
Do you want to continue? [Y/n]
No packages are going to be removed, and all the problematic packages are going to be downgraded to the supported versions. Excellent! Lets go ahead and do that.
After all the installation is complete, sudo apt install -f
says that everything is fine. When the smoke clears, we just need to review our system and figure out if we’re still missing some functionality (don’t forget to make sure plasma-pa
and pipewire-pulse
are installed, for audio support in Plasma).
Good luck!