apt install
我正在尝试使用(或)安装程序,apt-get install
但由于 avahi-daemon 的错误,它总是失败。
参见下文(忽略已安装的 wine 程序。我尝试的任何程序都会发生这种情况):
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)
我不知道 avahi-daemon 是什么,但谷歌搜索显示我可能需要编辑该文件/etc/avahi/avahi-daemon.conf
。它似乎与网络有关(我猜那是 Avahi mDNS/DNS-SD 中的 DNS)。
特别是,我看到了一些改变的建议domain-name
。例如这里和这里。我的文件中的那行被注释掉了。我尝试过取消注释,将其更改为alocal
和localhost
,但没有任何效果。下面是我的 .conf 文件。
# 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
我也尝试过手动启动服务,但失败了
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!
并尝试编辑错误消息中出现的第 21 行:AVAHI_DAEMON_DETECT_LOCAL=0
。尝试将其更改为=1
并将其注释掉。仍然失败。
这个问题实际上阻止了我更新或安装许多新软件。我似乎也无法升级到 Ubuntu 22.04,也许这有关?
知道是什么原因造成的以及怎样解决吗?
答案1
我遇到过同样的问题。
我注释掉了以下几行:ratelimit-interval-usec=1000000 ratelimit-burst=1000
并启用-dbus = no
不确定这是否可取,但我现在可以进行“apt upgrade”而不会出现任何错误。