0

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

7
  • 1
    We don't know your OS & release details; but I'd use that knowledge & check the results of python3 --version are correct for your unstated release; as python3 errors are commonly the result of incorrect python3 version changes.
    – guiverc
    Dec 27, 2021 at 8:10
  • Os is kubuntu 20.04, and python3 version is 3.9.9.
    – Aprime
    Dec 27, 2021 at 8:12
  • 2
    and there is your issue; you've changed your default python3 to a result that doesn't belong in 20.04; reverse your python3 changes & do it properly.
    – guiverc
    Dec 27, 2021 at 8:14
  • Dude I need 3.9.9 python:) What's the proper issue? Can you suggest a link or something?
    – Aprime
    Dec 27, 2021 at 8:16
  • 2
    Does this answer your question? Ubuntu 16.04 Completely broken python3 + dpkg + apt-get!
    – guiverc
    Dec 27, 2021 at 8:49

0

Browse other questions tagged .