sudo apt update
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
Press ENTER
to confirm adding repository.
sudo apt install python3.10 python3.10-venv python3.10-dev
python3 --version
You will see previous of Python. At the writing time Python 3.8.10
Caution
This may cause problem with terminal not open on Ubuntu
https://askubuntu.com/questions/1397938/terminal-not-opening-after-changing-python-version
ls -la /usr/bin/python3
sudo rm /usr/bin/python3
sudo ln -s python3.10 /usr/bin/python3
python3 --version
Now you will see Python 3.10.x
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
python3.10 -m pip --version
python3.10 -m pip install ipython
python3.10 -m venv venv
pip install ipython
https://computingforgeeks.com/how-to-install-python-on-ubuntu-linux-system/
I tried but still get the error "apt_pkg"
![Screenshot 2024-05-30 150118](https://private-user-images.githubusercontent.com/20698332/335095449-5af84343-ead7-4796-9470-a958c6e8fc2f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyMjI0MzksIm5iZiI6MTcyMTIyMjEzOSwicGF0aCI6Ii8yMDY5ODMzMi8zMzUwOTU0NDktNWFmODQzNDMtZWFkNy00Nzk2LTk0NzAtYTk1OGM2ZThmYzJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE3VDEzMTUzOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFkNmEyODNhNmRlYTVkNzhlNjFjYWM5Yzg3NjczMDVkMDAzNTA0OWNiNTI2YWMzMmEzOTBiMTc2YjQzMWZhM2UmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.MEZrVDswvHnz40-PbVIJcEnWLNImja4tJ79LHNOefEw)