We were also hit by this issue in Kali Linux, it broke apt during a few
hours until I could fix it at the repository level.
I think that it would also have been better if the apt hook ended with
"|| true", so that users still have a usable apt whenever cnf misbehaves.
Ie. in file
https://salsa.debian.org/jak/command-not-found/-/blob/main/data/50command-not-found:
|"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 || true;
fi";|
Thanks!
--
Arnaud Rebillout / Offensive Security / Kali Linux Developer