作为上面的问题,当我尝试运行sudo update-command-not-found时,我会得到这个错误
Traceback (most recent call last):
File "/usr/sbin/update-command-not-found", line 26, in <module>
col.create(db)
File "/usr/share/command-not-found/CommandNotFound/db/creator.py", line 94, in create
self._fill_commands(con)
File "/usr/share/command-not-found/CommandNotFound/db/creator.py", line 132, in _fill_commands
self._parse_single_contents_file(con, f, fp.stdout)
File "/usr/share/command-not-found/CommandNotFound/db/creator.py", line 228, in _parse_single_contents_file
l = l.decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 15: invalid continuation byte我试过很多方法来摆脱这个。问题似乎归结于'utf-8‘问题。有什么想法吗?
发布于 2020-12-22 12:43:34
对于任何有类似问题的人来说,最简单的解决办法是:
LC_ALL=C.UTF-8 update-command-not-found这适用于许多类似的UTF-8问题,与任何类型的安装有关。求你放过我!
发布于 2020-09-08 16:15:30
在从Raspbian扩展到Raspbian破坏者之后,我在Raspberry Pi上也有同样的问题。
在我的例子中,根本原因是apt工具改变了存储在/var/lib/apt/lists/*Contents*中的文件的格式,而这些文件现在是用.lz4格式编码的。因此,update-command-not-found命令无法再读取它们。
这可能可以通过新版本的“命令未找到”工具(https://code.launchpad.net/command-not-found)来解决。
https://askubuntu.com/questions/1232373
复制相似问题