Unable to Locate Python2 in Ubuntu 22.04

I already did sudo apt update and sudo apt install python2 but at the end I retrieve the same message...

Leyendo lista de paquetes... Hecho
Creando árbol de dependencias... Hecho
Leyendo la información de estado... Hecho
E: No se ha podido localizar el paquete python2

I added the following repository, but still no luck...

ppa:deadsnakes/ppa

Where can I find it? thank you

P.S:

after executing apt update

Leyendo lista de paquetes... Hecho
Creando árbol de dependencias... Hecho
Leyendo la información de estado... Hecho
Se pueden actualizar 13 paquetes. Ejecute «apt list --upgradable» para verlos.
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias... Hecho
Leyendo la información de estado... Hecho
E: No se ha podido localizar el paquete python2
7

1 Answer

SOLUTION:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo nano /etc/apt/sources.list

Remove everything and paste:

 jammy main restricted universe multiverse
# deb-src  jammy main restricted universe multiverse

deb  jammy-updates main restricted universe multiverse
# deb-src  jammy-updates main restricted universe multiverse

deb  jammy-security main restricted universe multiverse
# deb-src  jammy-security main restricted universe multiverse

deb  jammy-backports main restricted universe multiverse
# deb-src  jammy-backports main restricted universe multiverse

deb  jammy partner
# deb-src  jammy partner

and then:

sudo apt update

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest