I am running Kali 2.0 64-bit, and I recently noticed that avahi-daemon is starting at boot time, listening on several udp ports.

How do I disable it completely, without purging the package itself?

I have tried sudo rcconf --off avahi-daemon

But there is a warning: Service 'avahi-daemon' is already off. Skipping...

I then tried sudo update-rc.d -f avahi-daemon remove

It doesn't produce any errors, nor warnings, but avahi-daemon still persists at boot time.

I then tried editing the /etc/default/avahi-daemon file by adding AVAHI_DAEMON_START = 0

But that doesn't work either.

I finally used the UPSTART manual override -->> echo manual | sudo tee /etc/init/avahi-daemon.override

And still no go.

Please help,

I am at my wits's end!

Thank you.


4 Answers 4


sudo systemctl disable avahi-daemon to disable boot time startup.

A few other options are systemctl list-units for a list of all known units, systemctl enable to enable boot time startup, systemctl start to start the service from terminal, but not enable boot time loading and systemctl stop to stop a service which has been started. man systemctl and man systemd will provide complete set of options.

Most (not all though) modern Linux distributions have switched or are switching to systemd from the traditional SysV init scripts. Also, http://blog.jorgenschaefer.de/2014/07/why-systemd.html covers some of the basics of systemd.

  • somehow, avahi-daemon wont stop even after systemctl stop avahi-daemon. The message is Warning: Stopping avahi-daemon.service, but it can still be activated by: avahi-daemon.socket. And when I see the status it restarts automatically. Ubuntu 16.04 Commented Apr 11, 2017 at 10:31
  • 5
    A systemd .socket unit is designed to auto-start a service whenever something else needs it. This need is detected by a connection to an IPC or network socket, which systemd then passes on to the service, similar to inetd. If you don't want this behavior, you should disable the socket unit too: systemctl disable avahi-daemon.socket. Alternatively, systemctl mask avahi-daemon.service explicitly blocks the service from starting for any reason.
    – telcoM
    Commented Mar 22, 2018 at 15:50
  • 2
    Unfortunately, after some experimentation, I've found the only way to get avahi-daemon to stop -- even momentarily -- is to disable it completely using @Daniel's answer below. The only thing I would add is the --now flag to the disable command, which both stops and disables the unit, rather than just keeping it from starting on boot: sudo systemctl disable --now avahi-daemon.socket && sudo systemctl disable --now avahi-daemon.service
    – kael
    Commented Jun 8, 2018 at 21:36

My solution was to edit /etc/avahi/avahi-daemon.conf and make the following change: use-ipv4=no use-ipv6=no

Then do a root@magrf# service avahi-daemon restart

Verify that avahi daemon is stopped: root@magrf# ps -ef | grep avahi root 8311 8220 0 17:50 pts/0 00:00:00 grep avahi root@magrf#

As you can see, avahi processes are not running. If restart fails, try an explicit root@magrf# service avahi-daemon stop root@magrf# service avahi-deamon start

Restart is important so avahi could re-read configuration and shutdown service processes. Then it had performed a graceful exit.

  • 2
    This is genius! avahi has been a pita for me for years, I used to chmod -x the binary and this used to work.. but nowadays that makes other gnome features hang waiting for an answer from this pinnacle of despair.
    – axkibe
    Commented Aug 30, 2019 at 14:38

Use the following to stop the service, avoid restart on the next boot and prevent apps that tickle the socket from restarting it.

sudo systemctl mask avahi-daemon
sudo systemctl disable avahi-daemon
sudo systemctl stop avahi-daemon
  • 1
    This is the answer. Not only does it work, but it seems like intended operation instead of a hack. Afterwards, systemctl status avahi-daemon.service responds with "Loaded: masked (Reason: Unit avahi-daemon.service is masked.) Active: inactive (dead)"
    – bitsmack
    Commented May 17, 2022 at 4:46
  • I did not notice any problems at first, but it seems like document scan with xsane needs it for some reason
    – lgekman
    Commented Dec 13, 2023 at 11:10

You can disable it with:

systemctl disable avahi-daemon.socket


systemctl disable avahi-daemon.service
  • This didn't prevent Avahi from becoming active again after a reboot. Raspberry Pi OS (Debian-based) 2022-04-04.
    – bitsmack
    Commented May 17, 2022 at 4:40
  • Use "mask" to completely disable a service.
    – nvd
    Commented Nov 10, 2022 at 22:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .