0

What I've done :

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.9
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2

python --version

Now I have multiple errors, I can't start terminator or update, when I start mate terminal I have this error :

/usr/bin/screenfetch: /usr/bin/lsb_release : /usr/bin/python3 : mauvais interpréteur: Aucun fichier ou dossier de ce type

When I actualise with synaptic I have this error :

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

All these errors began with the installation of python as I describe in the beginning.

Gy0m
  • 311

2 Answers2

0

I had a similar problem with a Python upgrade, but also including dependencies outside the repository. Honestly, the best, most efficient way to solve this is to completely remove it and do a fresh, clean install.

edit: I don't know if the spelling in your post is the same you enetered into your terminal, but your first problem is you spelled the package wrong.

  • i have new error trying to remove python : E: Sub-process /usr/bin/dpkg returned an error code (1) – Gy0m Dec 18 '20 at 15:32
  • /var/lib/dpkg/info/language-selector-gnome.postinst: 6: py3compile: not found dpkg : error while cleaning up: installed language-selector-gnome package post-installation script subprocess returned error exit status 127 – Gy0m Dec 18 '20 at 15:32
  • You can use this command to remove it:

    sudo apt-get autoremove --purge

    There is another command to delete unused dependencies:

    sudo apt autoremove

    If that doesn't help, post again.

    – Víðarr Kerr Dec 18 '20 at 20:06
0

I have found that post : Problem with sudo apt update in Ubuntu 18.04: Post-Invoke-Success if /usr/bin/test -w /var/lib/command-not-found/

and i find an answer by doing :

apt download python3-minimal
sudo apt install --reinstall ./python3-minimal_*.deb
sudo apt install -f

I had to reinstall some few apps after that few lines and all is back to normal.

Gy0m
  • 311