| Tested on | Ubuntu 26.04 LTS (Resolute Raccoon), amd64 Ubuntu 24.04 LTS & 22.04 LTS (Docker; Deadsnakes install and venv) |
|---|---|
| Package | python3.13 — 3.13.16-1+resolute1 (26.04)3.13.16-1+noble1 (24.04)3.13.16-1+jammy1 (22.04) |
| Applies to | Ubuntu 22.04 LTS (jammy), 24.04 LTS (noble), and 26.04 LTS (resolute) |
| Privilege | sudo for apt and the PPA; normal user for venv, pip, pyenv, and uv |
| Scope | Install Python 3.13 alongside Ubuntu's system python3 with Deadsnakes, verify coexistence, create a 3.13 venv, update, and uninstall safely. Does not replace /usr/bin/python3, teach full source builds, or cover per-project Git packaging beyond a venv pointer. |
| Related guides | Install latest Python on Ubuntu Install Python 3.12 on Ubuntu Install Python 3.14 on Ubuntu Install Python 3.15 on Ubuntu pip command not found Uninstall Python on Ubuntu |
Install Python 3.13 when a project, wheel, or CI image pins the 3.13 branch—not because you want the newest upstream CPython.
Python 3.13 is still supported through October 2029, but after 3.13.16 (September 2026) the series is security-fix-only. Prefer 3.14 or 3.15 for new applications unless something explicitly requires 3.13.
On every Ubuntu LTS in this guide, 3.13 is a side-by-side interpreter: python3 stays on the release default while python3.13 serves pinned work.
Quick answer: Python 3.13 on Ubuntu by release
Ubuntu 26.04, 24.04, and 22.04 do not use Python 3.13 as system python3. Install it beside the distro interpreter with the Deadsnakes PPA—a community Launchpad archive, not Canonical or python.org:
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt updateConfirm the candidate comes from Deadsnakes for your suite (resolute, noble, or jammy) before you install:
apt-cache policy python3.13Install the interpreter and the venv module package:
sudo apt install python3.13 python3.13-venvVerify both commands:
python3.13 --version
python3 --versionCreate an isolated 3.13 environment (packages stay inside the venv, not on system python3):
python3.13 -m venv ~/venvs/py313
source ~/venvs/py313/bin/activate
python --version
python -m pip install --upgrade pipDo not replace /usr/bin/python3 or use update-alternatives to make 3.13 Ubuntu's system default.
Before you install Python 3.13 on Ubuntu
Ubuntu uses its system python3 for operating-system tools and many apt packages. Do not remove it, replace /usr/bin/python3, or run sudo update-alternatives --config python3 to point the default at Python 3.13.
This guide installs Python 3.13 alongside the distro interpreter:
| Ubuntu LTS | System python3 series |
Additional command |
|---|---|---|
| 26.04 | 3.14 | python3.13 |
| 24.04 | 3.12 | python3.13 |
| 22.04 | 3.10 | python3.13 |
For project libraries, create a virtual environment (venv) with python3.13 -m venv instead of sudo pip install on system python3. PEP 668 marks the distro interpreter as externally managed on current Ubuntu releases.
Use check Ubuntu version if you are unsure which row applies.
Deadsnakes is widely used but community-maintained. Its maintainers do not guarantee the same security-update timing as Ubuntu's archive or python.org. On security-critical production hosts, evaluate containers, vendor runtimes, uv, or pyenv instead of relying on a PPA alone.
Because Deadsnakes is a third-party PPA, confirm your normal patching process actually updates its packages. Ubuntu release upgrades may disable third-party PPAs—re-check the repository after moving to a new Ubuntu release.
Python 3.13 on Ubuntu 26.04, 24.04, and 22.04
Which Python version does each Ubuntu release use?
| Ubuntu | Default python3 |
Why install 3.13? |
|---|---|---|
| 26.04 | 3.14 | Project requires 3.13 and is not validated on 3.14 yet |
| 24.04 | 3.12 | Dependency or CI pins the 3.13 series |
| 22.04 | 3.10 | Application requires 3.13 while keeping system 3.10 unchanged |
Is Python 3.13 still supported?
| Python branch | Status (October 2026) | Support through (approx.) |
|---|---|---|
| 3.15 | Current stable feature release | ~Oct 2031 |
| 3.14 | Bugfix | ~Oct 2030 |
| 3.13 | Security fixes only after 3.13.16 | Oct 2029 |
Upstream 3.15 is the newest feature release. Install 3.13 when a lockfile, wheel, or test matrix names that branch—not simply because it is newer than your Ubuntu default.
Check your Ubuntu release and system Python
Record the distro interpreter before you add Deadsnakes so you can confirm nothing changed afterward:
python3 --versionSee which binary python3 resolves to:
readlink -f /usr/bin/python3Lab checks before adding Deadsnakes (host 26.04; clean amd64 containers on 24.04 and 22.04):
| Ubuntu | python3 --version |
readlink -f /usr/bin/python3 |
|---|---|---|
| 26.04 | Python 3.14.4 | /usr/bin/python3.14 |
| 24.04 | Python 3.12.3 | /usr/bin/python3.12 |
| 22.04 | Python 3.10.12 | /usr/bin/python3.10 |
Patch numbers on your machine may differ slightly from upstream python.org because Ubuntu backports security fixes on its own schedule. Minimal cloud images that ship without python3 yet should run sudo apt install python3 before comparing versions—not because Deadsnakes requires it, but so python3 --version reflects the distro interpreter.
Install Python 3.13 with Deadsnakes on Ubuntu
A PPA (Personal Package Archive) is an extra APT repository on Launchpad. Deadsnakes packages alternate Python versions Ubuntu does not ship as the release default.
Install software-properties-common on Ubuntu
Minimal images may not include add-apt-repository. Install the helper package first:
sudo apt update
sudo apt install software-properties-commonIf the command is still missing, see add-apt-repository command not found.
Add the Deadsnakes PPA for Python 3.13 on Ubuntu
Enable the PPA and refresh indexes with the apt command:
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt updateDeadsnakes publishes more than one Python-related package. For a typical dev machine, installing only the explicit python3.13* packages is simpler than APT pinning; use pinning only when you have tested repository preference rules.
Verify the Python 3.13 package source on Ubuntu
Confirm APT sees a Deadsnakes candidate for your codename:
apt-cache policy python3.13In apt-cache policy output, Candidate is the version APT would install if you ran sudo apt install python3.13 now.
Sample from the 26.04 lab (before install):
python3.13:
Installed: (none)
Candidate: 3.13.16-1+resolute1
Version table:
3.13.16-1+resolute1 500
500 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu resolute/main amd64 PackagesOn 24.04 and 22.04, the candidate string includes the suite suffix (+noble1, +jammy1) and the same ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu URL with noble or jammy in the path.
If Candidate: (none) appears, verify the PPA was added, run sudo apt update, and confirm check Ubuntu version matches a supported suite (jammy, noble, resolute).
Install Python 3.13 and python3.13-venv
The python3.13-venv package provides the venv module for this interpreter so you can run python3.13 -m venv:
sudo apt install python3.13 python3.13-venvVerify Python 3.13
Check that the versioned command reports the Deadsnakes build:
python3.13 --versionPython 3.13.16Optional: list the installed Debian packages:
dpkg -l 'python3.13*' | grep '^ii'Create a Python 3.13 virtual environment
Create the venv
Pick a directory under your home folder (for example ~/venvs/py313):
python3.13 -m venv ~/venvs/py313The venv bootstraps its own pip and python binaries inside that tree—project installs do not modify Ubuntu's system Python.
Activate it
Load the venv into your current shell:
source ~/venvs/py313/bin/activateYour shell prompt may show (py313). While active, python refers to the venv interpreter.
Verify the interpreter and pip
Inside the activated venv:
python --versionPython 3.13.16Confirm which binary runs:
command -v python/home/user/venvs/py313/bin/pythonUpgrade pip inside the venv (not with sudo):
python -m pip install --upgrade pipIf pip is missing or broken before Python is set up, see pip command not found.
Install project dependencies only after activation—for example install Flask on Ubuntu uses the same .venv pattern with a different Python minor.
Confirm Ubuntu's system Python is unchanged
Leave the venv, then compare versions:
deactivate
python3 --version
python3.13 --versionVerified coexistence after deactivate on all three LTS releases (3.13.16 from Deadsnakes in each run):
| Ubuntu | python3 --version |
python3.13 --version |
|---|---|---|
| 26.04 | Python 3.14.4 | Python 3.13.16 |
| 24.04 | Python 3.12.3 | Python 3.13.16 |
| 22.04 | Python 3.10.12 | Python 3.13.16 |
If python3 suddenly reports 3.13.x, you likely changed alternatives or symlinks—restore the release default before using apt tools.
Do not replace Ubuntu's system Python when installing 3.13
Do not:
- Run
sudo update-alternatives --config python3to select Python 3.13 - Replace or manually symlink
/usr/bin/python3 sudo pip installinto systempython3(use the venv)
Ubuntu packages expect the release-owned python3 series. Versioned commands (python3.13) and project venvs are the safe pattern on every LTS release.
Alternative ways to install Python 3.13 on Ubuntu
| Method | Best for |
|---|---|
| Deadsnakes | Ubuntu users who want versioned .deb packages and python3.13 on PATH |
| pyenv | Developers switching between many Python versions per directory |
| uv | Fast, project-local Python + venv workflows (install latest Python on Ubuntu covers setup) |
These paths install Python outside the Deadsnakes packages—updates and security maintenance follow their own tooling, not apt upgrade alone.
Install Python 3.13 with pyenv on Ubuntu
List available 3.13 patch releases, then install a concrete version (not a placeholder 3.13.x):
pyenv install --list | grep -E '^[[:space:]]*3\.13\.'Install the patch release you need and pin it in the current directory:
pyenv install 3.13.16
pyenv local 3.13.16Install Python 3.13 with uv on Ubuntu
uv manages its own Python builds separately from APT:
uv python install 3.13
uv venv --python 3.13For a full comparison of methods, start at install latest Python on Ubuntu.
Update Python 3.13
Refresh indexes and upgrade only the 3.13 packages:
sudo apt update
sudo apt install --only-upgrade python3.13 python3.13-venvConfirm the patch level:
python3.13 --versionWithin the 3.13 branch, Deadsnakes may move you from one patch release to another. Rebuild or recreate venvs only when a project requires it—most patch upgrades do not force a new venv.
For pyenv or uv, use those tools' own update commands rather than apt.
Uninstall Python 3.13
Ubuntu 22.04, 24.04, and 26.04
Remove the Deadsnakes packages when you no longer need the interpreter:
sudo apt remove python3.13 python3.13-venvDelete project venv directories separately if you no longer need them (rm -rf ~/venvs/py313 only when you intend to drop that environment).
Do not remove Ubuntu's python3 package or the release-owned Python interpreter during cleanup. Broader removal patterns live in uninstall Python on Ubuntu.
Troubleshooting Python 3.13 on Ubuntu
| Symptom | Likely cause | What to try |
|---|---|---|
add-apt-repository: command not found |
software-properties-common missing |
sudo apt install software-properties-common |
Unable to locate package python3.13 |
PPA not added, wrong suite, or stale cache | Re-add PPA; sudo apt update; verify Ubuntu codename |
python3.13: command not found after install |
Install failed or wrong PATH | dpkg -l python3.13; reinstall packages |
No module named venv |
python3.13-venv not installed |
sudo apt install python3.13-venv |
pip missing before venv |
No venv yet | Create venv; use python -m pip inside it |
python3 shows 3.13 after install |
update-alternatives or manual symlink |
Do not repoint system python3; fix alternatives |
| Wheel build fails in venv | Package lacks 3.13 wheel yet | Check project docs; try newer Python or build deps |
Summary: install Python 3.13 on Ubuntu
On Ubuntu 26.04, 24.04, and 22.04, install Python 3.13 with the Deadsnakes PPA, confirm the candidate with apt-cache policy python3.13, and install python3.13 plus python3.13-venv. Use python3.13 and a venv for projects; leave python3 on the LTS default (3.14, 3.12, or 3.10).
Choose 3.13 when a project pins that branch—remember it is security-fix-only after 3.13.16 while 3.14 and 3.15 remain the better default for new work. Do not use update-alternatives on system python3. For newest upstream or pyenv/uv, use install latest Python on Ubuntu.
References
- Deadsnakes PPA
- Python 3.13.16 release
- Python developer's guide — status of Python branches
- PEP 668 — externally managed environments
Frequently Asked Questions
Is Python 3.13 the latest stable?
No. Python 3.15 is the newest stable feature release as of October 2026. 3.13 remains supported for security fixes through October 2029 and fits projects that pin the 3.13 series.
Can Python 3.13 coexist with python3 on Ubuntu 26.04?
Yes. On 26.04, python3 stays on the 3.14 series while python3.13 is a separate command. Verify with python3 --version and python3.13 --version after install.
Does this work on Ubuntu 24.04 and 22.04?
Yes. Add the Deadsnakes PPA, install python3.13 and python3.13-venv, and use a venv. Confirm the APT candidate matches your codename before installing.
Should I use Deadsnakes, pyenv, or uv?
Use Deadsnakes when you want python3.13 as an Ubuntu package. Use pyenv or uv when you manage many versions per user or per project—see the latest-Python guide.
Will installing 3.13 upgrade Ubuntu's system Python?
No, when you follow this guide. System python3 changes only if you alter alternatives or symlinks manually.

