使用sudo apt update.
Hit:1 http://it.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://it.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://it.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:5 http://archive.canonical.com/ubuntu bionic InRelease
Traceback (most recent call last):
File "/usr/lib/cnf-update-db", line 8, in <module>
from CommandNotFound.db.creator import DbCreator
ModuleNotFoundError: No module named 'CommandNotFound'
Reading packages list... 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
Run Code Online (Sandbox Code Playgroud)
这些是结果 sudo apt install --reinstall command-not-found
Reading package …Run Code Online (Sandbox Code Playgroud)