0

I'm trying to install PulseAudio, but apt-get finds no installation candidate:

$ sudo apt-get install pulseaudio
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package pulseaudio is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'pulseaudio' has no installation candidate

Note that unlike this question or its duplicates, apt-get is not reporting any unmet dependencies.

apt-cache shows that versions are available, but there is no candidate:

$ apt-cache policy pulseaudio
pulseaudio:
  Installed: (none)
  Candidate: (none)
  Version table:
    1:11.1-1ubuntu7.5 -1
       500 http://au.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
    1:11.1-1ubuntu7 -1
       500 http://au.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

So it looks like, unlike this question, I can see the package I want, but I can't figure out why it can't be installed.

How can I resolve this?

Jeremy
  • 101

2 Answers2

0

Turns out the package was pinned.

$ ls /etc/apt/preferences.d/
libasound2-plugins.pref  pulseaudio.pref
$ cat /etc/apt/preferences.d/pulseaudio.pref
Package: pulseaudio
Pin: version *
Pin-Priority: -1

I couldn't find any documentation on how to remove pins nicely, so I just deleted the files

$ sudo rm /etc/apt/preferences.d/*.pref

And then I could install the package.

$ sudo apt-get install pulseaudio
…
The following NEW packages will be installed:
… pulseaudio …
Jeremy
  • 101
0

I had a similar issue trying to install php8.1-* packages on buster and bullseye docker containers and indeed found a pin under /etc/apt/preferences.d/no-debian-php and after removing it, I managed to install my packages properly.

So whatever pins you have there, you need to delete them:

rm /etc/apt/preferences.d/*