How can I cleanly remove PulseAudio in Ubuntu 14.04?

Solution 1:

You can't remove Pulseaudio in Ubuntu 14.04 without breaking some dependencies. The sound indicator and the sound options panel, even the control center itself, are dependent on Pulseaudio.

Pulseaudio is just a userspace daemon. But you can't simple kill Pulseaudio since it will be respawned by the init system.

jorge@den:~$ ps aux | grep pulseaudio
jorge     3797  0.0  0.1 440464  7360 ?        S<l  17:40   0:00 /usr/bin/pulseaudio --start --log-target=syslog
jorge     3803  0.0  0.0  98392  3028 ?        S    17:40   0:00 /usr/lib/pulseaudio/pulse/gconf-helper
jorge     4057  0.0  0.0  23900   924 pts/0    S+   17:51   0:00 grep --color=auto pulseaudio
jorge@den:~$ pkill -f pulseaudio
jorge@den:~$ ps aux | grep pulseaudio
jorge     4063  6.0  0.1 440680  7236 ?        S<l  17:51   0:00 /usr/bin/pulseaudio --start --log-target=syslog
jorge     4067  0.0  0.0  98392  3028 ?        S    17:51   0:00 /usr/lib/pulseaudio/pulse/gconf-helper
jorge     4069  0.0  0.0  23900   924 pts/0    S+   17:51   0:00 grep --color=auto pulseaudio

You can tell Pulseaudio not to respawn itself by issuing this command:

echo "autospawn = no" > $HOME/.config/pulse/client.conf

You can now kill pulseaudio:

jorge@den:~$ pkill -f pulseaudio
jorge@den:~$ ps aux | grep pulse
jorge     6310  0.0  0.0  23900   916 pts/1    S+   18:11   0:00 grep --color=auto pulse

Pulseaudio should be restarted on session startup, but it might be terminated if there is no sound activity, so after you are done, remember to remove the file you have created before, so Pulseaudio can be respawned when needed.

rm $HOME/.config/pulse/client.conf

Solution 2:

You can easily remove pulseaudio with apt-get:

apt-get remove --purge pulseaudio

or with apt:

apt purge pulseaudio

Solution 3:

The above answer is a good solution. To ease the process one could put it in a practical script. For example:

echo autospawn = no > $HOME/.config/pulse/client.conf
pulseaudio --kill
read -p "Press enter to enable pulseaudio again."
rm $HOME/.config/pulse/client.conf
pulseaudio --start

I didn't think of it, merely adapted it. This script works for me in Ubuntu 16.04.