Best Way to Install Python 3.13 on AlmaLinux/Rocky Linux Without Errors

Python 3.13 is packed with new features, performance improvements, and security enhancements, making it a great choice for developers and system admins. If you’re running AlmaLinux or Rocky Linux, you may need the latest Python version for compatibility with new software and frameworks.

In this guide, we’ll walk you through the best way to install Python 3.13 on AlmaLinux and Rocky Linux without errors—ensuring a smooth and efficient setup.

Prerequisites

Before installing Python 3.13, make sure you have:
AlmaLinux 8/9 or Rocky Linux 8/9 installed
Root or sudo access to your server
Internet connection for downloading dependencies

Step-by-Step Installation Guide

Step 1: Update Your System

First, update your system to ensure all packages are current. Run:

sudo dnf update -y

sudo dnf install -y gcc gcc-c++ make

This will help prevent compatibility issues during the Python installation.

Step 2: Enable the EPEL & PowerTools Repositories

Python 3.13 requires certain libraries that might not be available in the default repos. Enable EPEL and PowerTools (or CRB in AlmaLinux 9/Rocky Linux 9):

sudo dnf install -y epel-release

sudo dnf config-manager --set-enabled crb

For Rocky Linux 8/AlmaLinux 8, use:

sudo dnf config-manager --set-enabled powertools

Step 3: Install Development Tools

Python requires build tools for compilation. Install them using:

sudo dnf groupinstall -y "Development Tools"

sudo dnf install -y gcc gcc-c++ make bzip2-devel libffi-devel

Step 4: Download & Compile Python 3.13

Now, let’s download the official source code and compile Python:

cd /usr/src

sudo curl -O https://www.python.org/ftp/python/3.13.0/Python-3.13.0.tgz

sudo tar xvf Python-3.13.0.tgz

cd Python-3.13.0

Run the configuration script:

sudo ./configure --enable-optimizations

Compile and install:

sudo make -j$(nproc)

sudo make altinstall

Note: We use make altinstall instead of make install to prevent replacing the default system Python.

Step 5: Verify Installation

Check if Python 3.13 is installed correctly:

python3.13 --version

You should see output like:

Python 3.13.0

Managing Python Versions (Optional)

If you have multiple Python versions, you can use update-alternatives to switch between them:

sudo alternatives --install /usr/bin/python python /usr/local/bin/python3.13 1

sudo alternatives --config python

Then, select Python 3.13 as the default.

Conclusion

You have successfully installed Python 3.13 on AlmaLinux/Rocky Linux without errors! 🎉 Now, you can start using Python’s latest features for your development projects.

Why Choose Python 3.13?

Faster execution & better memory management
New security features & bug fixes
Improved compatibility with modern applications

Comments

Popular posts from this blog

Complete Guide: How to Install & Use OpenSSL on Windows Server 2025

FastAPI & MongoDB on Ubuntu 24.04 – The Ultimate Setup Guide