apt-get updateを実行すると、「KeyError: 'non-free-firmware'」が表示されます。

apt-get updateを実行すると、「KeyError: 'non-free-firmware'」が表示されます。

次のコマンドを使用して更新を実行します。

apt-get update

返品:

Hit:1 http://kali.download/kali kali-rolling InRelease
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 27, 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 282, in _parse_single_contents_file
    priority = component_priorities[component]
KeyError: 'non-free-firmware'
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'

誰かが追跡を説明できますか?

ベストアンサー1

Kaliには新しいセクションがありますが、non-free-firmwareあなたのバージョンではcommand-not-foundこれを知りません(バージョン23.04.0に追加されました)。

この問題を解決するには、フックを無効にします。

sudo mv /etc/apt/apt.conf.d/50command-not-found{,.disabled}

apt updateその後、正常に実行できます。バージョンが変更されたら、command-not-foundフックを再度有効にしてください。

sudo mv /etc/apt/apt.conf.d/50command-not-found{.disabled,}

おすすめ記事