Errors when doing apt update

I recently installed KDE Neon and after a few days of using it I noticed ‘apt update’ throws some errors. I’m able to install packages, but perhaps it’s erroring out on a repository.

Any idea what could be causing this issue?

paul@computer:~$ sudo apt update [sudo] password for paul: Get:1 file:/var/lib/preinstalled-pool jammy InRelease Ign:1 file:/var/lib/preinstalled-pool jammy InRelease Get:2 file:/var/lib/preinstalled-pool jammy Release [3,949 B] Get:2 file:/var/lib/preinstalled-pool jammy Release [3,949 B] Hit:4 http://packages.microsoft.com/repos/code stable InRelease Get:5 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB] Hit:6 http://archive.ubuntu.com/ubuntu jammy InRelease Get:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB] Hit:8 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy InRelease Get:9 http://archive.neon.kde.org/user jammy InRelease [189 kB] Fetched 418 kB in 1s (351 kB/s)

Traceback (most recent call last):
File “/usr/lib/cnf-update-db”, line 32, in
col.create(db)
File “/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py”, line 95, in create
self._fill_commands(con)
File “/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py”, line 142, in _fill_commands
self._parse_single_commands_file(con, sub.stdout)
File “/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py”, line 181, in _parse_single_commands_file
if not tagf.step():
apt_pkg.Error: E:Unable to parse package file (1)
Error in sys.excepthook:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/apport_python_hook.py”, line 153, in apport_excepthook
with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] No such file or directory: ‘/var/crash/_usr_lib_cnf-update-db.0.crash’

Original exception was:
Traceback (most recent call last):
File “/usr/lib/cnf-update-db”, line 32, in
col.create(db)
File “/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py”, line 95, in create
self._fill_commands(con)
File “/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py”, line 142, in _fill_commands
self._parse_single_commands_file(con, sub.stdout)
File “/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py”, line 181, in _parse_single_commands_file
if not tagf.step():
apt_pkg.Error: E:Unable to parse package file (1)
Reading package lists… Done
W: file:/var/lib/preinstalled-pool/dists/jammy/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
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

The recommended way to update Neon using the command-line is with pkcon update; does that work?

pkcon update looks to be fine. When I open the Discover app, it popups the error from apt.

paul@computer:~$ sudo pkcon update
[sudo] password for paul:
Getting updates [=========================]
Finished [=========================]
No packages require updating to newer versions.

Very interesting. This may be a Neon packaging/configuration bug, if you don’t recall doing anything yourself related to any of the files or packages it mentions.

No, I was just installing via Discovery or apt install. I don’t believe I changed any of those files.

I just ran a pkcon refresh and got the same error.

paul@computer:~$ sudo pkcon refresh
Refreshing cache [=========================]
Loading cache [=========================]
Downloading update information [=========================]
Running [=========================]
Finished [=========================]
Fatal error: W: file:/var/lib/preinstalled-pool/dists/jammy/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
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