我有 Xubuntu 21.04 64 位。每次我执行“apt upgrade”时都会出现错误消息:
Setting up avahi-daemon (0.8-5ubuntu3.1) ...
invoke-rc.d: syntax error: unknown option "--skip-systemd-native"
dpkg: error processing package avahi-daemon (--configure):
installed avahi-daemon package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of avahi-utils:
avahi-utils depends on avahi-daemon (= 0.8-5ubuntu3.1); however:
Package avahi-daemon is not configured yet.
dpkg: error processing package avahi-utils (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
avahi-daemon
avahi-utils
E: Sub-process /usr/bin/dpkg returned an error code (1)
你能帮助我吗?谢谢。
我尝试使用此命令来获取更多信息:
sudo apt-get update; sudo apt-get install -f; sudo dpkg --configure -a
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://prerelease.keybase.io/deb stable InRelease
Hit:3 https://brave-browser-apt-release.s3.brave.com stable InRelease
Hit:4 https://linux.teamviewer.com/deb stable InRelease
Hit:5 http://ru.archive.ubuntu.com/ubuntu hirsute InRelease
Hit:6 http://ru.archive.ubuntu.com/ubuntu hirsute-updates InRelease
Hit:7 http://ru.archive.ubuntu.com/ubuntu hirsute-backports InRelease
Hit:8 http://packages.microsoft.com/repos/code stable InRelease
Get:9 http://security.ubuntu.com/ubuntu hirsute-security InRelease [110 kB]
Hit:10 http://ppa.launchpad.net/shutter/ppa/ubuntu hirsute InRelease
Ign:12 http://linux.dropbox.com/ubuntu disco InRelease
Hit:13 http://linux.dropbox.com/ubuntu disco Release
Hit:14 https://download.sublimetext.com apt/stable/ InRelease
Hit:11 https://apt.llvm.org/groovy llvm-toolchain-groovy-13 InRelease
Fetched 110 kB in 2s (58,5 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up avahi-daemon (0.8-5ubuntu3.1) ...
invoke-rc.d: syntax error: unknown option "--skip-systemd-native"
dpkg: error processing package avahi-daemon (--configure):
installed avahi-daemon package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of avahi-utils:
avahi-utils depends on avahi-daemon (= 0.8-5ubuntu3.1); however:
Package avahi-daemon is not configured yet.
dpkg: error processing package avahi-utils (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
avahi-daemon
avahi-utils
E: Sub-process /usr/bin/dpkg returned an error code (1)
Setting up avahi-daemon (0.8-5ubuntu3.1) ...
invoke-rc.d: syntax error: unknown option "--skip-systemd-native"
dpkg: error processing package avahi-daemon (--configure):
installed avahi-daemon package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of avahi-utils:
avahi-utils depends on avahi-daemon (= 0.8-5ubuntu3.1); however:
Package avahi-daemon is not configured yet.
dpkg: error processing package avahi-utils (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
avahi-daemon
avahi-utils
which invoke-rc.d, dpkg -S $(which invoke-rc.d), apt-cache policy $(dpkg -S $(which invoke-rc.d) | awk -F: '{print $1}')
/usr/bin/dpkg
/usr/bin/apt-cache
答案1
您需要删除过时的sysv-rc
软件包并重新安装invoke-rc.d
里面有相应的包装经过
sudo dpkg -P --force-all sysv-rc
sudo apt-get install --reinstall init-system-helpers
然后重试运行
sudo apt-get update
sudo apt-get install -f
sudo dpkg --configure -a