On all Ubuntu releases since at least 19.10, enabling compressed APT package list storage with command-not-found installed leads to this crash in the cnf-update-db hook called by apt update:
Traceback (most recent call last):
File "/usr/lib/cnf-update-db", line 26, in <module>
col.create(db)
File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 93, in create
self._fill_commands(con)
File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 127, in _fill_commands
self._parse_single_commands_file(con, fp)
File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 165, in _parse_single_commands_file
suite=tagf.section["suite"]
KeyError: 'suite'
(To enable compressed APT list storage, add Acquire::GzipIndexes "true"; to an apt.conf fragment.)
This appears to be caused by apt downloading an lz4-compressed command list for command-not-found and cnf-update-db passing the /var/lib/apt/lists/*Commands-*.lz4 files to db/creator.py, which does not know about the compression and attempts to parse them as plain text.
On all Ubuntu releases since at least 19.10, enabling compressed APT package list storage with command-not-found installed leads to this crash in the cnf-update-db hook called by apt update:
Traceback (most recent call last): cnf-update- db", line 26, in <module> python3/ dist-packages/ CommandNotFound /db/creator. py", line 93, in create _fill_commands( con) python3/ dist-packages/ CommandNotFound /db/creator. py", line 127, in _fill_commands _parse_ single_ commands_ file(con, fp) python3/ dist-packages/ CommandNotFound /db/creator. py", line 165, in _parse_ single_ commands_ file tagf.section[ "suite" ]
File "/usr/lib/
col.create(db)
File "/usr/lib/
self.
File "/usr/lib/
self.
File "/usr/lib/
suite=
KeyError: 'suite'
(To enable compressed APT list storage, add Acquire: :GzipIndexes "true"; to an apt.conf fragment.)
This appears to be caused by apt downloading an lz4-compressed command list for command-not-found and cnf-update-db passing the /var/lib/ apt/lists/ *Commands- *.lz4 files to db/creator.py, which does not know about the compression and attempts to parse them as plain text.