SUMMARY | 问题概要
Package command-not-found is a handler for command_not_found that looks up programs not currently installed but available from the repositories. Package rinter-driver-bisheng-lexmark-z23-z33-color-jetprinter has a file with GB18030 encoding file name:
./usr/share/ppd/printer-driver-deepinwine/Lexmark \264\362ӡ\273\372\307\375\266\257\263\314\320\362-Lexmark Z23-Z33 Color Jetprinter.ppd
This will crash command-not-found's apt trigger while command-not-found building its database.
/usr/share/command-not-found/CommandNotFound/db/creator.py:242:
Log:
忽略:1 https://community-packages.deepin.com/beige beige InRelease
命中:3 https://app-store-files.uniontech.com/250102153637985/appstorev23 beige InRelease
命中:2 https://cdn-community-packages.deepin.com/driver-23 driver InRelease
命中:4 https://community-packages.deepin.com/beige beige Release
Traceback (most recent call last):
File "/usr/lib/cnf-update-db", line 32, in <module>
col.create(db)
File "/usr/share/command-not-found/CommandNotFound/db/creator.py", line 96, in create
self._fill_commands(con)
File "/usr/share/command-not-found/CommandNotFound/db/creator.py", line 141, in _fill_commands
self._parse_single_contents_file(con, f, sub.stdout)
File "/usr/share/command-not-found/CommandNotFound/db/creator.py", line 241, in _parse_single_contents_file
l = l.decode("utf-8")
^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb4 in position 48: invalid start byte
正在读取软件包列表... 完成
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
SOFTWARE/OS VERSIONS | 软件/系统版本信息
Distro: Deepin 23
Package: printer-driver-bisheng-lexmark-z23-z33-color-jetprinter
PRE-REQUIREMENT | 预置条件
command-not-found is installed.
- Its database
/var/lib/command-not-found/* is not exists.
STEPS TO REPRODUCE | 复现步骤
- Setup a Deepin V23 distro.
- Run
sudo apt install command-not-found in root user.
- Make sure that
/var/lib/command-not-found/* is not exists.
- Make sure that command
command-not-found zsh show this:
没有找到 command-not-found 的数据库。请运行 “sudo apt update” 以增充数据库。
zsh:未找到命令
- Run
sudo apt update
OBSERVED RESULT | 观察到的结果
EXPECTED RESULT | 期望的结果
忽略:1 https://community-packages.deepin.com/beige beige InRelease
命中:3 https://cdn-community-packages.deepin.com/driver-23 driver InRelease
命中:2 https://app-store-files.uniontech.com/250102153637985/appstorev23 beige InRelease
命中:4 https://community-packages.deepin.com/beige beige Release
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
所有软件包均为最新。
ADDITIONAL INFORMATION | 额外补充
Use
try:
l = l.decode("utf-8")
except UnicodeDecodeError:
l = l.decode("gb18030")
in package command-not-found's /usr/share/command-not-found/CommandNotFound/db/creator.py can fix this problem. But IT'S NOT A GOOD IDEA.
SUMMARY | 问题概要
Package
command-not-foundis a handler for command_not_found that looks up programs not currently installed but available from the repositories. Packagerinter-driver-bisheng-lexmark-z23-z33-color-jetprinterhas a file with GB18030 encoding file name:./usr/share/ppd/printer-driver-deepinwine/Lexmark \264\362ӡ\273\372\307\375\266\257\263\314\320\362-Lexmark Z23-Z33 Color Jetprinter.ppdThis will crash command-not-found's apt trigger while command-not-found building its database.
/usr/share/command-not-found/CommandNotFound/db/creator.py:242:Log:
SOFTWARE/OS VERSIONS | 软件/系统版本信息
PRE-REQUIREMENT | 预置条件
command-not-foundis installed./var/lib/command-not-found/*is not exists.STEPS TO REPRODUCE | 复现步骤
sudo apt install command-not-foundin root user./var/lib/command-not-found/*is not exists.command-not-found zshshow this:sudo apt updateOBSERVED RESULT | 观察到的结果
EXPECTED RESULT | 期望的结果
ADDITIONAL INFORMATION | 额外补充
Use
in package
command-not-found's/usr/share/command-not-found/CommandNotFound/db/creator.pycan fix this problem. But IT'S NOT A GOOD IDEA.