Install Python on Ubuntu (Step-by-Step Guide)

1 min read

To install Python 3.13 on Ubuntu, follow these steps (Open the terminal and run):
# 1. Add the Python 3.13 PPA (Personal Package Archive)
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
# 2. Install Python 3.13
sudo apt install python3.13
# 3. Verify the Installation
python3.13 --version
# 4. Set Python 3.13 as the Default Python Version (Optional)
# First, add the Python 3.13 version to the alternative system:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 1
# Now you can select the default Python version
sudo update-alternatives --config python3
My goal here is to keep things simple and get you up and running with minimal effort. Instead of breaking these four steps into separate commands, which you'd have to copy and run one by one, I've combined them into a single command. This way, you can install Python on Ubuntu in one go.
0
Subscribe to my newsletter
Read articles from JayRam Nai directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

JayRam Nai
JayRam Nai
Open edX expert and open-source enthusiast.