To celebrate the update, Alex wrote a simple Python script to print a message:
| Issue | Why it happens | Fix | |-------|----------------|-----| | apt breaks after changing Python | System tools hardcode python3 as system version | Never uninstall default python3 package | | pip installs globally without --user | Permissions error or risk breaking OS packages | Use --user flag or virtual environments | | python command missing | Ubuntu doesn’t symlink python → python3 by default | Install python-is-python3 | | SSL/Crypto errors when building from source | Missing dev libraries | Install libssl-dev , libffi-dev | update python ubuntu
sudo apt remove python3 # ❌ Breaks Ubuntu sudo ln -sf /usr/bin/python3.12 /usr/bin/python3 # ❌ Risky To celebrate the update, Alex wrote a simple
The is the most popular way to install newer (or older) Python versions alongside your system's default version. It is maintained by community members and provides packages for nearly every Python release. Step-by-Step Installation: YouTube·The Code City How to Install Python 3.12 in Ubuntu 22.04 (2024 Update) It is the safest method for development machines
This method bypasses the system package manager entirely. It is the safest method for development machines because it creates a "sandboxed" user environment where the OS Python is completely ignored for user tasks.
sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev wget https://www.python.org/ftp/python/3.13.0/Python-3.13.0.tgz tar -xf Python-3.13.0.tgz cd Python-3.13.0 ./configure --enable-optimizations --prefix=/usr/local make -j $(nproc) sudo make altinstall # Never use `install` (would override system python3)
If you need a very recent version not in deadsnakes: