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. – guiverc Dec 27 '21 at 08:10python3
the machine comes with; so you'll have to leave the default python3 be what the machine comes with (python3
defaults to 3.9.9 for my newer release) and use a second/newer python3 for your scripts that rely on it; OR don't use Ubuntu tools that rely on python3 being the default (eg. live withapt
& like tools that are designed/tested to work only with the default python3). As I said do it properly (and don't change the default!) Your question/problem here is because you changed the python3 version incorrectly. – guiverc Dec 27 '21 at 08:48