所以我最近更新了我的 Kali Linux VM。我开始收到此错误,但我不知道这意味着什么。尝试用谷歌搜索,但没有找到任何解决方案。也许我没有使用正确的关键字。
root@kali:/home/kali/Downloads/opt# apt update
Get:1 http://kali.download/kali kali-rolling InRelease [30.5 kB]
Get:2 http://security.debian.org stable/updates InRelease [65.4 kB]
Get:3 http://kali.download/kali kali-rolling/main amd64 Packages [17.6 MB]
Get:4 http://security.debian.org stable/updates/main amd64 Packages [266 kB]
Get:5 http://security.debian.org stable/updates/main i386 Packages [265 kB]
Get:6 http://security.debian.org stable/updates/main Translation-en [142 kB]
Hit:7 http://ftp.debianclub.org/debian stable InRelease
Get:8 http://kali.download/kali kali-rolling/main i386 Packages [17.5 MB]
Hit:9 http://old.kali.org/kali moto InRelease
Get:10 http://kali.download/kali kali-rolling/main amd64 Contents (deb) [39.5 MB]
Get:11 http://kali.download/kali kali-rolling/main i386 Contents (deb) [39.1 MB]
Get:12 http://kali.download/kali kali-rolling/contrib amd64 Packages [105 kB]
Get:13 http://kali.download/kali kali-rolling/contrib amd64 Contents (deb) [118 kB]
Get:14 http://kali.download/kali kali-rolling/non-free amd64 Packages [209 kB]
Get:15 http://kali.download/kali kali-rolling/non-free i386 Packages [177 kB]
Get:16 http://kali.download/kali kali-rolling/non-free i386 Contents (deb) [874 kB]
Get:17 http://kali.download/kali kali-rolling/non-free amd64 Contents (deb) [923 kB]
Fetched 117 MB in 14s (8,526 kB/s)
Traceback (most recent call last):
File "/usr/lib/cnf-update-db", line 26, in <module>
col.create(db)
File "/usr/share/command-not-found/CommandNotFound/db/creator.py", line 95, in create
self._fill_commands(con)
File "/usr/share/command-not-found/CommandNotFound/db/creator.py", line 143, in _fill_commands
self._parse_single_contents_file(con, f, fp.stdout)
File "/usr/share/command-not-found/CommandNotFound/db/creator.py", line 239, in _parse_single_contents_file
l = l.decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8a in position 58: invalid start byte
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
root@kali:/home/kali/Downloads/opt#
我试过
apt-fix-missing 安装
它已成功完成,但当我运行 apt update 和 apt upgrade 时结果没有变化
有什么修复吗?这是我的 sources.list 文件
root@kali:/home/kali/Downloads/opt# cat /etc/apt/sources.list
# Debian packages for stable
deb http://ftp.debianclub.org/debian/ stable main contrib
# Uncomment the deb-src line if you want 'apt-get source'
# to work with most packages.
# deb-src http://debmirror.hbcse.tifr.res.in/debian/ stable main contrib
# Security updates for stable
deb http://security.debian.org/ stable/updates main contrib
deb http://http.kali.org/kali kali-rolling main contrib non-free
# For source package access, uncomment the following line
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free
#deb http://http.kali.org/kali sana main non-free contrib
#deb http://security.kali.org/kali-security sana/updates main contrib non-free
# For source package access, uncomment the following line
# deb-src http://http.kali.org/kali sana main non-free contrib
# deb-src http://security.kali.org/kali-security sana/updates main contrib non-free
deb http://old.kali.org/kali moto main non-free contrib
# For source package access, uncomment the following line
# deb-src http://old.kali.org/kali moto main non-free contrib
root@kali:/home/kali/Downloads/opt#
答案1
只需在我的 sources.list 中评论以下 repo 即可找到答案。
德布http://old.kali.org/kalimoto 主要非自由贡献
我不确定它是如何修复的,因为我仍然不明白实际的问题是什么,但就目前而言,这是一个修复:)