I don't know what's wrong with my packages or ppas but every time I try to run sudo apt update
in my zsh terminal, it logs this error:
Fetched 222 kB in 1s (155 kB/s)
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 108, in create
os.rename(tmpdb, dbname)
IsADirectoryError: [Errno 21] Is a directory: '/var/lib/command-not-found/commands.db.tmp' -> '/var/lib/command-not-found/commands.db'
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
I just know it's a python error but I don't know what it means. Os is kubuntu 20.04, and python3 version is 3.9.9
python3 --version
are correct for your unstated release; as python3 errors are commonly the result of incorrect python3 version changes.