The correct way is sudo apt install python-is-python3 - it effectively does a symlink, but it also keeps pace with future updates; so if your ubuntu distribution moves to say Python 3.9, the manual symlink will no longer work, but the package makes sure it is still valid.

Answer from volferine on askubuntu.com
๐ŸŒ
DEV Community
dev.to โ€บ toddbirchard โ€บ managing-multiple-versions-of-python-on-ubuntu-2004-2c3l
Managing Multiple Versions of Python on Ubuntu 20.04 - DEV Community
May 3, 2022 - This is where a lot of people might turn to installing Python via Ubuntu's package manager with apt-get install python3.X. We're going to download and build the latest Python version from source, for a number of reasons.
People also ask

How to know the available version of Python in Ubuntu/Debian?
By running thepython -Vcommand, the available version of Python will be displayed.
๐ŸŒ
operavps.com
operavps.com โ€บ docs โ€บ how to change python default version in debian/ubuntu
How to Change Python Default Version in Debian/Ubuntu
What is the most stable version of Python to use in Debian/Ubuntu?
Python 3.10 is the best and most stable version to use on Ubuntu and Debian.
๐ŸŒ
operavps.com
operavps.com โ€บ docs โ€บ how to change python default version in debian/ubuntu
How to Change Python Default Version in Debian/Ubuntu
๐ŸŒ
Reddit
reddit.com โ€บ r/linuxquestions โ€บ how to change python version in ubuntu?
r/linuxquestions on Reddit: How to change python version in Ubuntu?
October 13, 2025 -

I run Ubuntu 24.04 on my laptop and it came pre installed with python 3.12.3, but I want to change it to python 3.13.7. I tried doing it following chatgpt once, but after that I couldnt open the terminal and I had to change it back to 3.12.3 via the terminal in VS Code.
Is there a safe way to change it to 3.13 or should I just stick to 3.12?

Find elsewhere
๐ŸŒ
OperaVPS
operavps.com โ€บ docs โ€บ how to change python default version in debian/ubuntu
How to Change Python Default Version in Debian/Ubuntu
February 12, 2026 - By using the update-alternatives command, you can prioritize the executable Python, and the version that has a high priority is set as the default version. By running the python -V command, the available version of Python will be displayed. ...
๐ŸŒ
MIT
web.mit.edu โ€บ 6.00 โ€บ www โ€บ handouts โ€บ pybuntu.html
Changing Default Python on Ubuntu
Setting python 2.6 as default on Linux ยท If you have a later version than 2.6 you'll need to set 2.6 as the default Python. Later versions would be 2.7 and 3.1; see what you have by typing python -V at the terminal. For purposes of this example we'll assume you have 3.1 installed.
๐ŸŒ
TecAdmin
tecadmin.net โ€บ how-to-switch-python-version-in-ubuntu-debian
How to Change Default Python Version on Ubuntu & Debian
April 26, 2025 - Create a symbolic link from /usr/bin/python2.7 to /usr/bin/python and set the group name as โ€œpythonโ€. This group name will be used to switch versions later. sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 ยท ...
๐ŸŒ
Digibeatrix
digibeatrix.com โ€บ home โ€บ development environment setup โ€บ how to check and switch python versions on ubuntu: complete guide for developers
How to Check and Switch Python Versions on Ubuntu: Complete Guide for Developers - Harnessing the Power of Open Source with Ubuntu
December 11, 2025 - On Ubuntu, python3 is the standard, while python may refer to Python 2. Therefore, using python3 --version is recommended. You can change the default Python version with update-alternatives or pyenv.
๐ŸŒ
CloudBytes
cloudbytes.dev โ€บ snippets โ€บ upgrade-python-to-latest-version-on-ubuntu-linux
Upgrade Python to latest version (3.13) on Ubuntu Linux or WSL2
January 6, 2025 - In first line, change #!/usr/bin/python3 to #!/usr/bin/python3.8. Press Ctrl +X followed by enter to save and exit. Then save and close the file. Next, update the default Python by adding both versions to an alternatives by running the below ยท sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 2
๐ŸŒ
LinuxHostSupport
linuxhostsupport.com โ€บ home โ€บ how to install and switch python versions on ubuntu 22.04
How to Install and Switch Python Versions on Ubuntu 22.04 | LinuxHostSupport
August 29, 2023 - You can enter any number and use that Python version. For example, we choose the Python3.10 by entering the number 1 ยท Execute the command sudo update-alternatives โ€“config python again, and you will notice the changed version:
๐ŸŒ
DEV Community
dev.to โ€บ meetsohail โ€บ change-the-python3-default-version-in-ubuntu-1ekb
Change the Python3 default Version in Ubuntu - DEV Community
November 8, 2020 - After research, I am come up with an easy solution to set python3 as a default on the ubuntu system. Check python version on terminal - python --version
๐ŸŒ
eUKhost
eukhost.com โ€บ home โ€บ how to install and switch python versions on ubuntu 22.04
How to install and switch Python versions on Ubuntu - eukhost
January 16, 2025 - In this article, we will provide a step-by-step process of installing multiple Python versions on Ubuntu 22.04.
Top answer
1 of 6
19

In almost all cases, this is a bad idea. Changing the system Python can and quite often will break some other packages depending on the previous environment or version. Upgrading from Python 3.10 to 3.13 means quite a few things have been changed and/or removed, making such problems likely.


So, how can you use a more modern version of Python?

One way ist the way you have already gone, installing it and accessing it via python3.13.

Another way is using the deadsnakes PPA, see e.g. this answer by Hannu (but refrain from overriding your system default).


And then there are multiple ways to get access to a specific Python version within a specific project, here is a small selection:

  1. Pyenv is the classic solution for this. It allows you to download and install basically any Python version (even alpha and beta) and activate them dynamically or use them as the base for a virtual environment.
  2. UV, a upcoming Python dependency manager, can manage Python versions as well. You just have to specify the desired Python version in a .python_version file in your project root directory.
  3. Conda, another dependency manager, but not limited to Python, can also manage multiple Python versions.
2 of 6
8

A simple "clean" way to install a more recent Python3 than present in Ubuntu is the deadsnakes ppa:

Howto set the default version:
https://www.debugpoint.com/install-python-3-12-ubuntu/
... at "Use Python 3.12 as the default Python3"

The basics for installation:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update 
sudo apt install python3.12

https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
The ppa gets updated, so a more recent one may well be present;
also ALWAYS verify the correctness of what is stated above.

๐ŸŒ
Greenwebpage
greenwebpage.com โ€บ home โ€บ blog โ€บ how to check and update the python version on ubuntu 24.04
How to Check and Update the Python Version on Ubuntu 24.04
April 4, 2025 - This guide will help explain how to check and update the Python version on Ubuntu 24.04 LTS also known as Noble Numbat.