在用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 这些是sudo apt install --reinstall command-not-found的结果
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/5.188 B of archives
After this operation, 0 B of additional disk space will be used.
(Reading the database ... 225797 files and directories currently installed.)
Preparations for extracting ... / command-not-found_18.04.4_all.deb ...
Extracting command-not-found (18.04.4) on (18.04.4) ...
Configuring command-not-found (18.04.4) ...
libdvd-pkg: Package libdvdcss2-1.4.2-1 was removed, stop processing...在重新安装命令not后,当我再次尝试命令sudo apt update时,结果与第一个文本块中描述的相同。
发布于 2018-05-28 15:10:05
在所有当前支持的Ubuntu版本中,打开终端并键入:
apt download python3-minimal
sudo apt install --reinstall ./python3-minimal_*.deb
sudo apt install -f如果这样做不起作用,那么简单的重新启动有时会解决这个问题。
发布于 2020-04-27 20:37:43
这解决了我同样/类似的问题:
cd /usr/lib/python3/dist-packages
ls -la /usr/lib/python3/dist-packages
sudo cp apt_pkg.cpython-36m-x86_64-linux-gnu.so apt_pkg.so来源:Linux问题
发布于 2018-07-17 16:45:51
包装libdvdcss2-1.4.2-1被删除,停止处理.
也在折磨我的系统..。对于上述方法的一个更全面的解释--这是有效的-- WOOHOO!这就是我所做的!
密码当然是在终端内部使用的..。
sudo find / -name 'CommandNotFound'结果,显示了这条模糊的道路
ack的数独密码:查找:‘/run/user/1000/gvfs’:权限被拒绝
所以这里引用的上述方法中不明显的部分..。
sudo cp -r /path/of/CommandNotFound /usr/lib/导致了一个错误,很明显,因为它是“通用的”。
但是在第一个命令中找到的这个文件路径的修改版本解决了这个问题. "/usr/lib/python3/dist-packages/CommandNotFound“
$ sudo cp -r /usr/lib/python3/dist-packages/CommandNotFound /usr/lib/问题就消失了
我希望这能帮上忙马克
https://askubuntu.com/questions/1041226
复制相似问题