Fix cPanel Update Failure Due to Missing Python 3.12

Issue

During cPanel update (upcp), you may encounter errors like:

/usr/bin/python3.12 is needed by cpanel-xxxx
Error: Unable to find a match: python312

This happens because Python 3.12 is not available in default RHEL/CloudLinux repositories.


Cause

  • cPanel newer builds depend on Python 3.12

  • RHEL-based systems (AlmaLinux, CloudLinux, RockyLinux) may not include it by default

  • dnf/yum install python312 fails


Solution Overview

We will:

  1. Compile Python 3.12 from source

  2. Create a dummy RPM package to satisfy cPanel dependency

  3. Map /usr/bin/python3.12 to compiled binary


Step 1: Install Required Build Tools

yum groupinstall "Development Tools" -y
yum install gcc openssl-devel bzip2-devel libffi-devel wget -y

Step 2: Compile Python 3.12 from Source

cd /usr/src
wget https://www.python.org/ftp/python/3.12.3/Python-3.12.3.tgz
tar xzf Python-3.12.3.tgz
cd Python-3.12.3

./configure --enable-optimizations
make -j$(nproc)
make altinstall

Verify:

/usr/local/bin/python3.12 -V

Step 3: Install RPM Build Tools

dnf install rpm-build -y

Step 4: Prepare RPM Build Environment

mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}

Step 5: Create Dummy RPM Spec File

nano ~/rpmbuild/SPECS/python312.spec

Paste:

Name: python312
Version: 3.12
Release: 1
Summary: Python 3.12 provider
License: GPL
BuildArch: noarch

%description
Provides /usr/bin/python3.12 for cPanel dependency.

%install
mkdir -p %{buildroot}/usr/bin
cat << 'EOF' > %{buildroot}/usr/bin/python3.12
#!/bin/bash
exec /usr/local/bin/python3.12 "$@"
EOF
chmod +x %{buildroot}/usr/bin/python3.12

%files
/usr/bin/python3.12

Step 6: Build RPM

rpmbuild -bb ~/rpmbuild/SPECS/python312.spec

Step 7: Install Dummy Package

rpm -ivh ~/rpmbuild/RPMS/noarch/python312-3.12-1.noarch.rpm

Step 8: Verify Installation

which python3.12
python3.12 -V
rpm -qf /usr/bin/python3.12

Step 9: Run cPanel Update Again

/scripts/upcp --force

Rollback (If Needed)

To remove dummy package:

rpm -e python312-3.12-1.noarch

Important Notes

  • make altinstall is used to avoid breaking system Python

  • Do NOT replace /usr/bin/python3

  • This method safely satisfies cPanel dependency without affecting OS stability

  • Dummy RPM only provides a wrapper, not actual Python binaries


Best Practice Recommendation

  • Always check if Python 3.12 is available via:

    • CloudLinux repos

    • AppStream modules

  • Use source build only when absolutely necessary

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Domain names are not showing in WHM

We were unable to see any domains listed under WHM -> List Accounts. However, we can see the...

How to Start/Stop or Restart Apache server

Apache is the HTTP server that is freely available over the internet. It is a kind of software or...

How to install Attracta SEO Tools plugin

RequirementscPanel/WHM needs to be installed on your server. Step 1: SSH into your server and go...

How to Install CpCleaner in cPanel through SSH?

Installation Run the following shell commands as root via SSH: wget -O cpc-1.0.3.tar...

How to Secure a cPanel/WHM Web Server

Here are a few basic steps that you should keep in mind for keeping a server secure. 1) Strong...