我对 Ubuntu 还很陌生。我不知道哪里出了问题,当我尝试以下命令时,突然出现此错误sudo apt-get update
sh: 1: /usr/lib/cnf-update-db: not found
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code
我也用过sudo dpkg --configure -a
然后我得到了这个:
dpkg: error processing package python3-distro-info (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of ubuntu-release-upgrader-gtk:
ubuntu-release-upgrader-gtk depends on python3-distupgrade (= 1:20.04.28); however:
Version of python3-distupgrade on system is 1:18.04.38.
dpkg: error processing package ubuntu-release-upgrader-gtk (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of update-manager-core:
update-manager-core depends on python3-update-manager (= 1:20.04.10.1); however:
Version of python3-update-manager on system is 1:18.04.11.13.
update-manager-core depends on python3-distro-info; however:
Package python3-distro-info is not configured yet.
dpkg: error processing package update-manager-core (--configure):
dependency problems - leaving unconfigured
Setting up libtinfo6:amd64 (6.2-0ubuntu2) ...
dpkg: dependency problems prevent configuration of ubuntu-release-upgrader-core:
ubuntu-release-upgrader-core depends on python3-distupgrade (= 1:20.04.28); however:
Version of python3-distupgrade on system is 1:18.04.38.
dpkg: error processing package ubuntu-release-upgrader-core (--configure):
dependency problems - leaving unconfigured
Setting up libffi7:amd64 (3.3-4) ...
dpkg: dependency problems prevent configuration of python3-debconf:
python3-debconf depends on debconf (= 1.5.66ubuntu1); however:
Version of debconf on system is 1.5.73.
dpkg: error processing package python3-debconf (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of update-manager:
update-manager depends on update-manager-core (= 1:18.04.11.13); however:
Version of update-manager-core on system is 1:20.04.10.1.
update-manager depends on ubuntu-release-upgrader-gtk; however:
Package ubuntu-release-upgrader-gtk is not configured yet.
dpkg: error processing package update-manager (--configure):
dependency problems - leaving unconfigured
Setting up libpython2.7-minimal:amd64 (2.7.18-1~20.04) ...
dpkg: dependency problems prevent configuration of python3-distupgrade:
python3-distupgrade depends on python3-distro-info; however:
Package python3-distro-info is not configured yet.
dpkg: error processing package python3-distupgrade (--configure):
dependency problems - leaving unconfigured
Setting up libreadline8:amd64 (8.0-4) ...
Setting up python2.7-minimal (2.7.18-1~20.04) ...
Setting up libncursesw6:amd64 (6.2-0ubuntu2) ...
dpkg: dependency problems prevent configuration of python3-update-manager:
python3-update-manager depends on python3-distupgrade; however:
Package python3-distupgrade is not configured yet.
dpkg: error processing package python3-update-manager (--configure):
dependency problems - leaving unconfigured
Setting up libpython2.7-stdlib:amd64 (2.7.18-1~20.04) ...
Setting up python2.7 (2.7.18-1~20.04) ...
Setting up libpython2.7:amd64 (2.7.18-1~20.04) ...
Setting up libpython2.7-dev:amd64 (2.7.18-1~20.04) ...
Setting up python2.7-dev (2.7.18-1~20.04) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Errors were encountered while processing:
python3-distro-info
ubuntu-release-upgrader-gtk
update-manager-core
ubuntu-release-upgrader-core
python3-debconf
update-manager
python3-distupgrade
python3-update-manager
提前致谢 !
答案1
这是 Xenial 下的一个已知错误。
请尝试:
cd /var/cache/app-info/xmls/ && sudo rm -iv fwupd.xml; cd
sudo appstreamcli refresh --force
sudo apt update
如果没有效果请尝试:
sudo apt full-upgrade -y
我希望这能对你有帮助。