1

I am trying to install a program with apt install (or apt-get install) but it always fails due to an error with the avahi-daemon.

See below (ignore the program wine is already installed. This happens with any program I try):

bgc@jadzia:~$ sudo apt-get install wine
Reading package lists... Done
Building dependency tree       
Reading state information... Done
wine is already the newest version (5.0-3ubuntu1).
The following packages were automatically installed and are no longer required:
  glib-networking:i386 gstreamer1.0-plugins-base:i386 gstreamer1.0-plugins-good:i386 
  ...cut out a lot here as i don't think it's relevant...
  ocl-icd-libopencl1:i386 remmina-common shim va-driver-all:i386 vdpau-driver-all:i386
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up avahi-daemon (0.7-4ubuntu7.1) ...
Job for avahi-daemon.service failed because the control process exited with error code.
See "systemctl status avahi-daemon.service" and "journalctl -xe" for details.
invoke-rc.d: initscript avahi-daemon, action "restart" failed.
● avahi-daemon.service - Avahi mDNS/DNS-SD Stack
     Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2022-09-28 22:17:19 PDT; 7ms ago
TriggeredBy: ● avahi-daemon.socket
    Process: 388962 ExecStart=/usr/sbin/avahi-daemon -s (code=exited, status=255/EXCEPTION)
   Main PID: 388962 (code=exited, status=255/EXCEPTION)

Sep 28 22:17:19 jadzia systemd[1]: Starting Avahi mDNS/DNS-SD Stack... Sep 28 22:17:19 jadzia avahi-daemon[388962]: Assignment outside group in /etc/avahi/avahi-daemon.conf:21 <AVAHI_DAEMON_DETECT_LOCAL=0> Sep 28 22:17:19 jadzia systemd[1]: avahi-daemon.service: Main process exited, code=exited, status=255/EXCEPTION Sep 28 22:17:19 jadzia systemd[1]: avahi-daemon.service: Failed with result 'exit-code'. Sep 28 22:17:19 jadzia systemd[1]: Failed to start Avahi mDNS/DNS-SD Stack. dpkg: error processing package avahi-daemon (--configure): installed avahi-daemon package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: avahi-daemon E: Sub-process /usr/bin/dpkg returned an error code (1)

I've no clue what avahi-daemon is, but googling has indicated I may need to edit the file /etc/avahi/avahi-daemon.conf. It seems to be something network related (I guess that's the DNS in Avahi mDNS/DNS-SD).

In particular, I've seen suggestions to change the domain-name. Such as here and here. That line in my file was commented out. I've tried uncommenting it, changing it to alocal and localhost, but that has had no effect. Below is my .conf file.

# This file is part of avahi.
#
# avahi is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# avahi is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with avahi; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

See avahi-daemon.conf(5) for more information on this configuration

file!

AVAHI_DAEMON_DETECT_LOCAL=0

[server] #host-name=foo #domain-name=local #browse-domains=0pointer.de, zeroconf.org use-ipv4=yes use-ipv6=yes #allow-interfaces=eth0 #deny-interfaces=eth1 #check-response-ttl=no #use-iff-running=no #enable-dbus=yes #disallow-other-stacks=no #allow-point-to-point=no #cache-entries-max=4096 #clients-max=4096 #objects-per-client-max=1024 #entries-per-entry-group-max=32 ratelimit-interval-usec=1000000 ratelimit-burst=1000

[wide-area] enable-wide-area=yes

[publish] #disable-publishing=no #disable-user-service-publishing=no #add-service-cookie=no #publish-addresses=yes publish-hinfo=no publish-workstation=no #publish-domain=yes #publish-dns-servers=192.168.50.1, 192.168.50.2 #publish-resolv-conf-dns-servers=yes #publish-aaaa-on-ipv4=yes #publish-a-on-ipv6=no

[reflector] #enable-reflector=no #reflect-ipv=no

[rlimits] #rlimit-as= #rlimit-core=0 #rlimit-data=8388608 #rlimit-fsize=0 #rlimit-nofile=768 #rlimit-stack=8388608 #rlimit-nproc=3

I've also tried starting the service manually, which fails

bgc@jadzia:~$ /etc/init.d/dbus start
Starting dbus (via systemctl): dbus.serviceFailed to start dbus.service: Operation refused, unit dbus.service may be requested by dependency only (it is configured to refuse manual start/stop).
See system logs and 'systemctl status dbus.service' for details.
 failed!

And tried editing line 21 that appears in the error message: AVAHI_DAEMON_DETECT_LOCAL=0. Tried changing it to =1 and commenting it out. Still fails.

This issue effectively prevents me from updating or installing a lot of new software. I also can't seem to upgrade to Ubuntu 22.04, perhaps this is related?

Any idea what's causing this and how to resolve it?

Brian C
  • 167
  • 1
  • 9
  • PLEASE do not upgrade or try to upgrade a broken system, Fix all issues before an upgrade. – David Sep 29 '22 at 06:36
  • Uh... This is me asking how to fix the issue... – Brian C Sep 29 '22 at 07:45
  • Ultimately I was never able to find a solution to this issue and due to some other, probably unrelated issues that I was having trouble addressing, I just wiped and reinstalled the entire OS. Now it works great! – Brian C Jan 09 '24 at 22:18

1 Answers1

0

I had the same issue.

I commented out the lines: ratelimit-interval-usec=1000000 ratelimit-burst=1000

and enable-dbus=no

Not sure if this is advisable, but I can now do an "apt upgrade" with no errors.

Adam
  • 341
  • I will try this and get back to you. – Brian C Nov 18 '22 at 00:25
  • 1
    Ultimately I was never able to find a solution to this issue and due to some other, probably unrelated issues that I was having trouble addressing, I just wiped and reinstalled the entire OS. Now it works great! – Brian C Jan 09 '24 at 22:18