apt-get error: cnf-update-db - KeyError: 'suite' (focal)

Bug #1872557 reported by jj05
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
New
Undecided
Unassigned

Bug Description

"apt-get update" fails to run when command-not-found is installed on Ubuntu 20.04.

To reproduce with Docker:
docker pull ubuntu:20.04 # Pull latest Ubuntu 20.04 docker image
docker run -it ubuntu:20.04 # Start an Ubuntu 20.04 docker container

# Within the container run:
apt-get update
apt-get -yy dist-upgrade
apt-get -yy install command-not-found
exec bash # Reload bash to load command-not-found
apt-get update # Update command-not-found database

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'
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

jj05 (h-launchpad-jj05)
description: updated
description: updated
description: updated
jj05 (h-launchpad-jj05)
description: updated
no longer affects: apt (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in command-not-found (Ubuntu):
status: New → Confirmed
Mathew Hodson (mhodson)
affects: command-not-found → command-not-found (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.