How to Install Python 3.14 on Ubuntu (26.04, 24.04, 22.04)

Last updated Wednesday, January 28, 2026 12:25 pm Joshua James 18 min read

Python 3.14 brings optional free-threaded builds, improved error messages, and typing enhancements to Ubuntu. With upstream security support through October 2030, it suits development environments and forward-looking projects that need the newest interpreter features before Ubuntu’s default packages catch up.

You can install Python 3.14 alongside Ubuntu’s default interpreter without conflicts. Ubuntu 26.04 LTS ships Python 3.13 as default but includes Python 3.14 in the official repositories, Ubuntu 24.04 LTS ships Python 3.12, and Ubuntu 22.04 LTS ships Python 3.10. Adding Python 3.14 gives you access to the latest language features while system utilities continue using the protected default version.

This guide covers installing Python 3.14 from the official Ubuntu 26.04 repositories, the Deadsnakes PPA for Ubuntu 24.04/22.04, or compiling from source for custom builds. You will also learn to bootstrap pip under PEP 668 rules, create isolated virtual environments, and safely remove the installation when you no longer need it.

When to Choose Python 3.14 on Ubuntu

Compare Python Releases for Ubuntu

Use the comparison below to decide whether Python 3.14 fits your Ubuntu environment or if an earlier interpreter better matches stability or vendor certification requirements.

Python VersionAvailability on UbuntuChoose It WhenTrade-offs
Install Python 3.8 on UbuntuDeadsnakes PPA or source build onlyLegacy applications pinned to EOL runtimes, compatibility testing, transitional migrationsEnd-of-life October 2024, no upstream security fixes, container isolation recommended
Install Python 3.10 on UbuntuDeadsnakes PPA for 24.04 LTS, Ubuntu 22.04 LTS defaultConservative production fleets targeting Canonical coverage through October 2026Older feature set, many libraries optimize for 3.11+, PPA required on 24.04 LTS
Install Python 3.11 on UbuntuDeadsnakes PPA for 24.04/22.04, source builds on 26.04CPU-bound workloads needing major speed gains and precise error locationsCommunity-maintained packages only, not default on any supported Ubuntu release
Install Python 3.12 on UbuntuUbuntu 24.04 LTS default, Deadsnakes PPA for 22.04 LTSGeneral-purpose development with Canonical-managed security updates through October 2028Ubuntu 22.04 LTS requires PPA, fewer concurrency enhancements than newer releases
Install Python 3.13 on UbuntuUbuntu 26.04 LTS default, Deadsnakes PPA for 24.04/22.04Teams validating newer optimizations with support through October 2029Community packages lack guaranteed security SLAs; some wheels lag initial releases
Python 3.14Ubuntu 26.04 LTS official repos, Deadsnakes PPA for 24.04/22.04, source builds for custom needsEarly adopters validating the newest interpreter changes with support through October 2030Not default on any release, PPA updates may trail upstream, ecosystem wheels may take time to catch up

Therefore, stay on Ubuntu’s default Python (3.13 on 26.04 LTS, 3.12 on 24.04 LTS, 3.10 on 22.04 LTS) for Canonical-managed security. Choose Python 3.14 on developer workstations, CI runners, or isolated services that benefit from the latest interpreter changes. Avoid replacing Ubuntu’s system Python.

Pre-Flight Checklist

Before installing Python 3.14, verify your system state to avoid redundant installs or conflicts:

# Check if Python 3.14 is already installed
python3.14 --version 2>/dev/null && echo "Python 3.14 already present" || echo "Python 3.14 not found, safe to install"

# Confirm your Ubuntu version (target LTS releases only)
lsb_release -rs

# Check available disk space (source builds need 300+ MB)
df -h /usr/local

Example output on Ubuntu 26.04 LTS (your output will show 24.04 or 22.04 if you run an older LTS):

Python 3.14 not found, safe to install
26.04

Disk space output will vary by system but should show free space under /usr/local:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       250G   40G  198G  17% /

If Python 3.14 is already installed, you can skip to the “Work in Python 3.14 Virtual Environments” section unless you need to rebuild with custom flags (like --disable-gil).

Key Reasons to Choose Python 3.14

Python 3.14 is attractive for:

  • Free-threaded runtime progress: Continued PEP 703 work with optional --disable-gil builds for concurrency experiments.
  • Typing and annotation updates: Better tooling for large projects and stricter type enforcement where needed.
  • Improved error messages: Clearer tracebacks and diagnostics when debugging modern codebases.
  • Security window through October 2030: A fresh five-year upstream support horizon for new deployments.
  • Ecosystem forward-compatibility: Early testing helps validate wheels and dependencies before production cutovers.

Choose Your Python 3.14 Installation Method

Your installation method depends on which Ubuntu release you run. Ubuntu 26.04 LTS includes Python 3.14 in the official repositories, so a standard APT install is all you need. Ubuntu 24.04 LTS and 22.04 LTS require the Deadsnakes PPA. Source compilation remains an option for custom builds or free-threaded (nogil) configurations on any release.

MethodChannelVersionUpdatesBest For
Ubuntu 26.04 Official ReposUbuntu archive3.14.xAPT updatesUbuntu 26.04 LTS users (simplest path)
Deadsnakes PPALaunchpad PPALatest 3.14.xAPT updatesUbuntu 24.04/22.04 LTS users who want packaged installs
Source compilationPython.org sourceLatest 3.14.xManual rebuildCustom prefixes, optimization flags, or --disable-gil builds

Ubuntu 26.04 LTS users should use the official repositories—no PPA or compilation required. Ubuntu 24.04 LTS and 22.04 LTS users should use the Deadsnakes PPA for packaged updates. Compile from source only when you need specific build flags (like --disable-gil for free-threaded builds) or a custom installation prefix.

Never replace /usr/bin/python3 or uninstall the system interpreter. Use versioned binaries like python3.14 and virtual environments for isolation.

This guide covers Ubuntu 26.04 LTS, 24.04 LTS, and 22.04 LTS. Choose the method that matches your release: official repos for 26.04 LTS, Deadsnakes PPA for 24.04/22.04 LTS, or source compilation for custom builds on any version.

Understand Support and Compatibility Limits

  • Ubuntu 26.04 LTS includes Python 3.14: Canonical provides packaged updates through the official repositories. Ubuntu 24.04/22.04 LTS require the Deadsnakes PPA.
  • Deadsnakes PPA is community maintained: The PPA maintainer provides no guaranteed security SLA. Monitor advisories and be ready to rebuild from source if patched packages lag.
  • Ecosystem catch-up period: Some third-party wheels lag new 3.14 releases. Check project compatibility notes and run pip check after installing dependencies.
  • Free-threaded builds remain experimental: Use --disable-gil for research and benchmarking, not production workloads. Library compatibility varies significantly. The Deadsnakes PPA provides python3.14-nogil packages for 24.04/22.04, but Ubuntu 26.04 official repos do not include nogil variants—compile from source if you need free-threaded builds on 26.04.

Python 3.14 reaches upstream end-of-life in October 2030, per the official release schedule (PEP 745). Plan migrations to Python 3.15 or newer before that date if you require ongoing security updates.

Python 3.14 Pre-Installation Steps

Update System Before Proceeding

Refresh package lists and apply available updates before adding PPAs or compiling from source to avoid dependency conflicts.

Open a terminal and run:

sudo apt update

Optionally upgrade installed packages:

sudo apt upgrade

Install Python 3.14 on Ubuntu

Choose the installation method that matches your Ubuntu release. Ubuntu 26.04 LTS includes Python 3.14 in the official repositories. Ubuntu 24.04 LTS and 22.04 LTS require the Deadsnakes PPA. Source compilation is available on all releases for custom builds.

Install Python 3.14 on Ubuntu 26.04 LTS (Official Repositories)

Ubuntu 26.04 LTS includes Python 3.14 in the official Ubuntu repositories. This is the simplest installation path—no PPA or compilation required.

Install Python 3.14 with the venv and development packages:

sudo apt install python3.14 python3.14-venv python3.14-dev

Verify the installation:

python3.14 --version
Python 3.14.2

Test that essential modules are available:

python3.14 -c "import ssl, sqlite3, bz2; print('Python 3.14 ready on Ubuntu 26.04')"
Python 3.14 ready on Ubuntu 26.04

Check the package source to confirm you are using the official Ubuntu repository:

apt-cache policy python3.14
python3.14:
  Installed: 3.14.2-1
  Candidate: 3.14.2-1
  Version table:
 *** 3.14.2-1 500
        500 http://archive.ubuntu.com/ubuntu resolute/main amd64 Packages
        100 /var/lib/dpkg/status

The Ubuntu 26.04 official repositories do not include python3.14-nogil packages. If you need free-threaded (no-GIL) builds on Ubuntu 26.04, you must compile from source with the --disable-gil flag.

Install Python 3.14 via Deadsnakes PPA (Ubuntu 24.04/22.04)

This method applies to Ubuntu 24.04 LTS (noble) and 22.04 LTS (jammy) only. Ubuntu 26.04 LTS users should use the official repositories method above.

Add the Deadsnakes PPA and refresh your package cache:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update

Confirm the PPA provides Python 3.14 packages before installing:

apt-cache policy python3.14
python3.14:
  Installed: (none)
  Candidate: 3.14.2-1+noble1
  Version table:
     3.14.2-1+noble1 500
        500 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu noble/main amd64 Packages

On Ubuntu 24.04 LTS, the Candidate line ends with +noble1; on Ubuntu 22.04 LTS, it ends with +jammy1.

Configure APT Pinning (Recommended)

Before installing, configure APT pinning to ensure only Python 3.14 packages come from this PPA. This step is optional but recommended for stability:

cat <<EOF | sudo tee /etc/apt/preferences.d/python3.14.pref
Package: *
Pin: release o=LP-PPA-deadsnakes
Pin-Priority: 100

Package: python3.14*
Pin: release o=LP-PPA-deadsnakes
Pin-Priority: 700
EOF

This creates a two-rule pinning configuration. The first rule deprioritizes all PPA packages, while the second rule prefers only Python 3.14 packages.

Install Python 3.14 packages:

sudo apt install python3.14 python3.14-venv python3.14-dev

The maintainer states there is no guarantee of timely security updates. Production systems must track CVEs and be ready to recompile or sandbox workloads until patches arrive. Use the PPA for development, CI, or testing and rely on Ubuntu’s default Python for system tooling. Monitor the Python Security Response Team page and the CVE.org search for Python for vulnerabilities. Subscribe to the Python Security Announcements mailing list to receive notifications when security patches are released.

Python 3.14 Availability: The Deadsnakes PPA publishes packages for Ubuntu 24.04 LTS (noble) and 22.04 LTS (jammy) only. Patch releases can lag upstream, so use the source build method if you need a newer point release immediately.

Verify the installation:

python3.14 --version
Python 3.14.2

Your output will show the current 3.14.x point release available from the PPA.

Full PPA Installation Example Walkthrough: On a fresh Ubuntu 24.04 LTS system, here is what a complete installation looks like:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.14 python3.14-venv python3.14-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3.14 is already the newest version (3.14.2-1+noble1).
Setting up python3.14-dev (3.14.2-1+noble1) ...
Setting up python3.14-venv (3.14.2-1+noble1) ...
Processing triggers for man-db (2.12.0-4build2) ...
Done.

Next, verify the installation and test essential modules (package version strings will move to newer 3.14.x point releases over time):

python3.14 -c "import ssl, sqlite3, bz2; print('Python 3.14 ready on Ubuntu')"
Python 3.14 ready on Ubuntu

Install Additional Python 3.14 Packages (Optional)

Both the Ubuntu 26.04 official repositories and the Deadsnakes PPA provide additional Python 3.14 packages. Install what you need based on your use case.

Debugging symbols for profiling and crash analysis:

sudo apt install python3.14-dbg

GNU dbm bindings for the dbm.gnu module:

sudo apt install python3.14-gdbm

Tkinter GUI support for graphical applications. If you also want the IDLE development environment, see the IDLE Python guide for Ubuntu:

sudo apt install python3.14-tk

Example scripts for documentation and quick functionality checks:

sudo apt install python3.14-examples

Free-Threaded (No-GIL) Packages (Deadsnakes PPA Only)

The Deadsnakes PPA for Ubuntu 24.04/22.04 includes free-threaded runtime packages that let you test no-GIL builds without compiling from source. These packages are not available in the Ubuntu 26.04 official repositories.

Install the free-threaded runtime:

sudo apt install python3.14-nogil python3.14-gdbm-nogil

The free-threaded binary installs as python3.14t. Verify it is available:

python3.14t --version
Python 3.14.2

Ubuntu 26.04 LTS users: If you need the free-threaded runtime, you must compile Python 3.14 from source with the --disable-gil configure flag. See the source compilation section below.

Install python3.14-full Meta-Package

Both the Ubuntu 26.04 official repos and the Deadsnakes PPA include a python3.14-full meta-package that bundles a complete set of standard library modules similar to Ubuntu’s system interpreter:

sudo apt install python3.14-full

For Ubuntu 24.04/22.04 LTS (Deadsnakes PPA), you can also include the no-GIL variants:

sudo apt install python3.14-full python3.14-nogil python3.14-gdbm-nogil

Compile Python 3.14 from Source on Ubuntu

Source compilation is useful when you need custom build flags (like --disable-gil for free-threaded builds), a custom installation prefix, or profile-guided optimizations beyond what packaged builds offer. This method works on all Ubuntu LTS releases.

Download Python 3.14 Source Tarball

Download the latest 3.14.x release from python.org and extract it. The snippet below uses curl to discover the newest patch version automatically:

Install baseline download utilities if they are missing on minimal images:

sudo apt install curl wget ca-certificates
PY314_VERSION="$(curl -fsSL https://www.python.org/ftp/python/ | grep -oE '3\.14\.[0-9]+' | sort -V | tail -1)" || { echo "Failed to fetch Python version"; exit 1; }
[ -z "$PY314_VERSION" ] && { echo "No 3.14.x version found"; exit 1; }
wget "https://www.python.org/ftp/python/${PY314_VERSION}/Python-${PY314_VERSION}.tar.xz" || exit 1
tar -xf Python-${PY314_VERSION}.tar.xz
cd Python-${PY314_VERSION}

If discovery fails or your host is air-gapped, visit the Python.org downloads page to find the latest 3.14.x release and substitute the version number manually. The script will exit with an error message rather than silently proceeding with missing versions.

Install Build Dependencies

Install libraries needed for SSL, compression, readline, Tk, and UUID support:

sudo apt install build-essential zlib1g-dev libncurses-dev libgdbm-dev libgdbm-compat-dev \
libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev libbz2-dev liblzma-dev \
uuid-dev libexpat1-dev tk-dev pkg-config make libzstd-dev

These package names work on Ubuntu 26.04 LTS, 24.04 LTS, and 22.04 LTS. The libzstd-dev package enables the new _zstd compression module introduced in Python 3.14.

Configure and Build Python 3.14

Compile with optimization and link-time optimization under /usr/local/python3.14 to avoid touching the system interpreter:

./configure --enable-optimizations --with-lto --with-ensurepip=install --prefix=/usr/local/python3.14
make -j"$(nproc)"
sudo make altinstall

To evaluate the free-threaded runtime, add --disable-gil to the configure command. This experimental build is intended for testing and benchmarking, not production.

make altinstall keeps /usr/bin/python3 untouched while adding /usr/local/python3.14/bin/python3.14.

Register Libraries and Test the Build

Afterward, point the dynamic linker at your custom installation, refresh the cache, and add a convenience symlink:

echo '/usr/local/python3.14/lib' | sudo tee /etc/ld.so.conf.d/python3.14.conf
sudo ldconfig
sudo ln -s /usr/local/python3.14/bin/python3.14 /usr/local/bin/python3.14

Verify the build and ensure critical modules compiled successfully:

python3.14 --version
python3.14 -c "import ssl, sqlite3, bz2; print('Source build is healthy')"
Python 3.14.2
Source build is healthy

Your output will show the specific 3.14.x version you compiled from source.

If the second command fails, install missing -dev packages, rerun ./configure, and rebuild.

Install Pip for Python 3.14

Pip typically ships with the interpreter, but verifying ensures package management works without touching system directories. For detailed pip usage including virtual environments and troubleshooting, see the pip installation guide for Ubuntu.

Bootstrap Pip via ensurepip

Keep pip scoped to Python 3.14 instead of the system interpreter. PPA installs require the venv module (which provides ensurepip). Source builds can skip the APT step if you configured --with-ensurepip=install and run ensurepip directly.

# PPA installs only
sudo apt install python3.14-venv

# PPA and source builds
python3.14 -m ensurepip --upgrade
python3.14 -m pip --version

Source builds display the /usr/local/ prefix in the output:

pip 25.3 from /usr/local/python3.14/lib/python3.14/site-packages/pip (python 3.14)

PPA installs show a system-managed path instead:

pip 25.3 from /usr/lib/python3/dist-packages/pip (python 3.14)

ensurepip installs pip inside Python 3.14’s site-packages even if the system interpreter differs. If your build was configured without ensurepip, create a virtual environment to get pip and keep packages isolated:

python3.14 -m venv ~/venvs/py314-base
source ~/venvs/py314-base/bin/activate
pip --version
pip 25.3 from /home/ubuntu/venvs/py314-base/lib/python3.14/site-packages/pip (python 3.14)

Bootstrap Pip with get-pip.py

For air-gapped hosts or custom builds, download the bootstrap script and run it with Python 3.14:

wget https://bootstrap.pypa.io/get-pip.py
python3.14 get-pip.py
rm get-pip.py

This installs pip, setuptools, and wheel together. Download a fresh copy each time you repeat the process.

Manage Packages with python3.14 -m pip

Invoke pip through the versioned interpreter to avoid cross-version conflicts:

python3.14 -m pip install package_name
python3.14 -m pip install --upgrade package_name
python3.14 -m pip uninstall package_name

Swap package_name with libraries such as numpy, fastapi, or django.

Ubuntu 24.04 LTS and 26.04 LTS mark the system Python (python3) as externally managed (see PEP 668). If you run python3 -m pip install <package>, pip blocks system-wide installs unless you use a virtual environment or pass --break-system-packages. Use –break-system-packages only when you fully understand the risks: it allows pip to write into system directories and can break apt upgrades or system utilities. Prefer virtual environments for all workloads.

Work in Python 3.14 Virtual Environments

Virtual environments isolate dependencies per project. For expanded workflows, see the Python virtual environment guide.

Create a Python 3.14 Virtual Environment

Choose a directory for environments (for example ~/venvs) and create one with Python 3.14:

python3.14 -m venv ~/venvs/py314

Replace ~/venvs/py314 with any path that fits your workflow.

Activate the Virtual Environment

Activate the environment so python and pip point to the local interpreter:

source ~/venvs/py314/bin/activate

The shell prompt updates with the environment name, indicating activation.

Deactivate the Virtual Environment

When finished, run:

deactivate

This returns the shell to the system Python context.

Troubleshooting Common Python 3.14 Installation Issues

Missing Development Headers During Compilation

If configure reports disabled modules for SSL, bz2, or sqlite, identify missing dependencies and reinstall them. Review the configure output directly:

./configure --enable-optimizations --with-lto --with-ensurepip=install --prefix=/usr/local/python3.14 2>&1 | grep "disabled"

Example output showing disabled modules:

The following modules have been disabled:
_hashlib _ssl
_bz2
_sqlite3
nis ossaudiodev

Some modules like nis and ossaudiodev are deprecated and safe to ignore. If _zstd appears missing, install libzstd-dev and reconfigure. The _zstd module is new in Python 3.14 and optional unless your code uses Zstandard compression.

Install the corresponding development headers and reconfigure:

sudo apt install libssl-dev libbz2-dev libsqlite3-dev
./configure --enable-optimizations --with-lto --with-ensurepip=install --prefix=/usr/local/python3.14
make -j"$(nproc)"
sudo make altinstall

Verify all modules loaded correctly after rebuild:

python3.14 -c "import ssl, sqlite3, bz2; print('All modules present')"

Shared Library Linking Errors

If python3.14 reports error while loading shared libraries: libpython3.14.so.1.0: cannot open shared object file, verify the library path and refresh the linker cache.

Example error message:

/usr/local/python3.14/bin/python3.14: error while loading shared libraries: libpython3.14.so.1.0: cannot open shared object file (No such file or directory)

Locate the library:

find /usr/local -name "libpython3.14.so*"
/usr/local/python3.14/lib/libpython3.14.so.1.0
/usr/local/python3.14/lib/libpython3.14.so

Update the linker cache for the custom prefix:

sudo ldconfig /usr/local/python3.14/lib

Or register the specific prefix for persistent library loading:

echo "/usr/local/python3.14/lib" | sudo tee /etc/ld.so.conf.d/python3.14.conf
sudo ldconfig

Verify the interpreter now loads correctly:

/usr/local/python3.14/bin/python3.14 --version
Python 3.14.2

PIP Externally Managed Environment Errors

On Ubuntu 24.04 LTS and 26.04 LTS, pip blocks installs to the system interpreter (python3) without a virtual environment. This does not affect Python 3.14 installed from the PPA or source.

error: externally-managed-environment

X This environment is externally managed
-> To install Python packages system-wide, try apt install
   xyz, where xyz is the package you are trying to
   install.

If you wish to install a Python package using pip, you must
create a virtual environment first.

Create a venv instead of bypassing protections:

python3 -m venv myproject_env
source myproject_env/bin/activate
pip install package-name

For CLI tools you want available system-wide, pipx provides isolated environments automatically. Install it with sudo apt install pipx, then use pipx install package-name to install tools without manually creating virtual environments.

Only use --break-system-packages in disposable environments:

python3 -m pip install --break-system-packages package-name

APT Errors After Adding the PPA

If apt errors mention Python after adding the Deadsnakes PPA, ensure you did not modify the system /usr/bin/python3 symlink. It should point to Ubuntu’s default interpreter.

Check the symlink:

ls -la /usr/bin/python3
lrwxrwxrwx 1 root root 10 Nov 12 12:15 /usr/bin/python3 -> python3.12

On Ubuntu 22.04 LTS the symlink points to python3.10; on Ubuntu 26.04 LTS it points to python3.13.

Restore it if needed:

# Ubuntu 26.04 LTS
sudo ln -sf /usr/bin/python3.13 /usr/bin/python3

# Ubuntu 24.04 LTS
sudo ln -sf /usr/bin/python3.12 /usr/bin/python3

# Ubuntu 22.04 LTS
sudo ln -sf /usr/bin/python3.10 /usr/bin/python3

Always call Python 3.14 explicitly with python3.14 instead of altering system links.

Virtual Environment Creation Fails

If python3.14 -m venv reports that ensurepip is unavailable, the venv module is missing. Install the venv package for PPA builds or confirm --with-ensurepip=install for source builds.

Example error:

Error: ensurepip is not available in this environment.

For PPA installations, install the venv module:

sudo apt install python3.14-venv
python3.14 -m venv myenv
source myenv/bin/activate

For source builds, verify --with-ensurepip=install was specified during configure, or bootstrap pip via get-pip.py as an alternative.

Update or Remove Python 3.14

Update Python 3.14 Packages

sudo apt update
sudo apt install --only-upgrade python3.14 python3.14-venv python3.14-dev

If you installed optional packages (such as python3.14-nogil or python3.14-tk), add them to the upgrade command.

Update Source-Compiled Python 3.14

Use the script below to rebuild the latest 3.14.x release when you installed from source:

#!/usr/bin/env bash
set -e

INSTALL_PREFIX="/usr/local/python3.14"
BUILD_DIR="/opt/python3.14-build"
LOG_FILE="$BUILD_DIR/update.log"
PY314_BIN="$INSTALL_PREFIX/bin/python3.14"

for cmd in gcc make curl wget tar; do
    if ! command -v "$cmd" >/dev/null 2>&1; then
        echo "Error: $cmd is required but not installed."
        echo "Run: sudo apt install build-essential curl wget"
        exit 1
    fi
done

if [ ! -x "$PY314_BIN" ]; then
    echo "Error: $PY314_BIN not found."
    echo "Install Python 3.14 from source before running this update script."
    exit 1
fi

CURRENT_VERSION="$("$PY314_BIN" --version | awk '{print $2}')"
LATEST_VERSION="$(curl -fsSL https://www.python.org/ftp/python/ | grep -oE '3\\.14\\.[0-9]+' | sort -V | tail -1)"

if [ -z "$LATEST_VERSION" ]; then
    echo "Error: Could not fetch the latest Python 3.14.x version."
    exit 1
fi

echo "Current version: $CURRENT_VERSION"
echo "Latest version:  $LATEST_VERSION"

if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then
    echo "Already up to date."
    exit 0
fi

sudo install -d -m 0755 "$BUILD_DIR"
sudo chown "$USER":"$USER" "$BUILD_DIR"
cd "$BUILD_DIR"

rm -rf Python-*/
wget "https://www.python.org/ftp/python/${LATEST_VERSION}/Python-${LATEST_VERSION}.tar.xz"
tar -xf "Python-${LATEST_VERSION}.tar.xz"
rm "Python-${LATEST_VERSION}.tar.xz"

cd "Python-${LATEST_VERSION}"
./configure --enable-optimizations --with-lto --with-ensurepip=install --prefix="$INSTALL_PREFIX"
make -j"$(nproc)"
sudo make altinstall

NEW_VERSION="$("$PY314_BIN" --version | awk '{print $2}')"
echo "$(date): Updated to $NEW_VERSION" >> "$LOG_FILE"
echo "Successfully updated to $NEW_VERSION"

Avoid automating this with cron. Compilation can fail due to missing dependencies, failed tests, or network issues. Always run the script manually so you can monitor the output and address problems before they affect your system.

Verify the updated version after the script completes:

/usr/local/python3.14/bin/python3.14 --version
Python 3.14.2

Remove Python 3.14 Packages

Python 3.14 is not the system interpreter on Ubuntu 26.04 LTS, 24.04 LTS, or 22.04 LTS. Removing it will not break apt as long as you leave /usr/bin/python3 unchanged. Verify your release before removal.

Remove Python 3.14 if you no longer need it. The same commands work whether you installed from Ubuntu 26.04’s official repositories or the Deadsnakes PPA on Ubuntu 24.04/22.04:

sudo apt remove --purge python3.14 python3.14-venv python3.14-dev
sudo apt autoremove

Confirm your Ubuntu version before removal:

lsb_release -rs
24.04

Remove the Deadsnakes PPA (Ubuntu 24.04/22.04 Only)

If you installed Python 3.14 from the Deadsnakes PPA on Ubuntu 24.04 or 22.04, remove the repository and pin file. Skip this step on Ubuntu 26.04 since you installed from official repositories:

sudo add-apt-repository --remove ppa:deadsnakes/ppa
sudo rm -f /etc/apt/preferences.d/python3.14.pref
sudo apt update

Clean Up Source-Compiled Installations

Remove source installs and related linker entries if you compiled Python 3.14 manually.

The following commands permanently delete the source-compiled Python 3.14 installation, including all modules and libraries under /usr/local/python3.14, plus any build files in /opt/python3.14-build if you used the update script. Virtual environments created with this interpreter will stop working. Back up anything you need first, for example cp -r /usr/local/python3.14 ~/python3.14-backup.

sudo rm -f /usr/local/bin/python3.14
sudo rm -rf /usr/local/python3.14
sudo rm -f /etc/ld.so.conf.d/python3.14.conf
sudo rm -rf /opt/python3.14-build
sudo ldconfig

Adjust the path if you used a custom prefix such as /opt/python3.14.

Frequently Asked Questions

Why isn’t Python 3.14 in Ubuntu 24.04 or 22.04 default repositories?

Canonical freezes major package versions at each LTS release to ensure stability. Ubuntu 22.04 shipped with Python 3.10, and Ubuntu 24.04 shipped with Python 3.12. Adding newer interpreters would require backporting changes that could break system tools. The Deadsnakes PPA exists specifically to provide newer Python versions without modifying Ubuntu’s base packages. Ubuntu 26.04 includes Python 3.14 because its package freeze occurred after Python 3.14’s release.

Can I have multiple Python versions installed at the same time?

Yes. Ubuntu supports running multiple Python interpreters simultaneously. Install Python 3.14 via the PPA, official repos (26.04), or source compilation alongside your default python3. Call each version explicitly (python3.14, python3.12, python3.10) and use virtual environments to isolate project dependencies. Never modify the /usr/bin/python3 symlink since Ubuntu system tools depend on it.

Is Python 3.14’s free-threaded mode ready for production use?

No. The free-threaded (no-GIL) build enabled by --disable-gil remains experimental in Python 3.14. PEP 703 introduced this as an opt-in feature for testing and benchmarking parallel workloads. Many C extensions and libraries have not been updated for thread safety without the GIL. Use free-threaded builds for research and performance experiments, not production applications.

Conclusion

You now have Python 3.14 running alongside Ubuntu’s default interpreter. Use versioned binaries like python3.14 and virtual environments to keep project dependencies isolated, and monitor the Python Security Announcements list for patches through the October 2030 support window. From here, you can test the free-threaded runtime, validate library compatibility, or start building applications with the latest language features.

Useful Links

Reference these resources while working with Python 3.14 on Ubuntu:

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffee Buy me a coffee

Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<a href="URL">link</a> link
<blockquote>quote</blockquote> quote block

Leave a Comment

We read and reply to every comment - let us know how we can help or improve this guide.

Let us know you are human: