How to disable avahi-daemon in Ubuntu 16.04 LTS?

26,592

Solution 1

Since 16.04 is a systemd system, you need to do

sudo systemctl disable avahi-daemon.socket
sudo systemctl disable avahi-daemon.service

Also, the cups-browsed.service "Wants" avahi to start, so you'll either have to disable that, too, or comment out the line in /lib/systemd/system/cups-browsed.service:

Wants=avahi-daemon.service

Then you don't need to uninstall anything.

This won't take effect until reboot, but you can do

sudo systemctl stop avahi-daemon.socket
sudo systemctl stop avahi-daemon.service

If you want to stop it right away.

Solution 2

After trying a couple of things, the one wich worked for me was

apt-get remove avahi-daemon

Solution 3

I have tried

update-rc.d -f avahi-daemon remove  
echo manual > /etc/init/avahi-daemon.override
systemctl disable avahi-daemon
systemctl disable avahi-service

but still avahi-daemon came up after reboot.
So I ended up with
apt-get purge avahi-daemon

which finally solved the problem for me.

Share:
26,592

Related videos on Youtube

D. Ktt
Author by

D. Ktt

Updated on September 18, 2022

Comments

  • D. Ktt
    D. Ktt almost 2 years

    How to disable avahi-daemon in Ubuntu 16.04 LTS? I have tried

    sudo sh -c "echo 'manual'>/etc/init/avahi-daemon.override"
    

    but seems it does not work.

    And how to disable cups-browsed? I have tried

    sudo sh -c "echo 'manual'>/etc/init/cups-browsed.override"
    

    but seems it does not work.

    • pahnin
      pahnin about 8 years
      I hate ubuntu for breaking everything
  • D. Ktt
    D. Ktt over 7 years
    sudo systemctl disable avahi-daemon.socket / sudo systemctl disable avahi-daemon.service - this doesn't work, after reboot avahi-daemon starts anyway.
  • labyrinth
    labyrinth over 7 years
    True. It turns out cups-browsed.service wants to pull it in. I've udpated my answer and verified avahi no longer starts on reboot on my system.
  • sudo
    sudo over 6 years
    Lol. Probably what everyone wants to do. I saw that thing using CPU and just deleted it.
  • prosti
    prosti almost 6 years
    liked the approach.
  • prosti
    prosti almost 6 years
    it's a dirty job, hopefully it will not came back again.
  • tyleha
    tyleha over 5 years
    I had to remove the avahi-autoipd package for this to take effect. Though the avahi-daemon was disabled and, in my case, uninstalled, ifup was still starting the avahi-autoipd service leading to my issues.