building python 3.9.5 on almalinux 8.3 (purple manul)

Alma Linux (or if you prefer, AlmaLinux) is essentially CentOS with a new coat of paint. IBM, owner of RedHat, who in turn owns CentOS, stirred up a hornet’s nest back in December 2020 when the owners announced that CentOS 8 was changing from a stable release of RHEL 8 to a rolling release of RHEL, and renaming it CentOS Stream. CentOS 8 is being end-of-lifed December of this year, 2021. Needless to say, there are a lot of unhappy CentOS users looking for an alternative.

AlmaLinux ( https://almalinux.org/ ) might be one of those alternatives. Originally created by CloudLinux Inc ( https://www.cloudlinux.com/ ) as a fork of their Linux distribution CloudLinux OS, Alma Linux is “an open-source, community-driven project that intends to fill the gap left by the demise of the CentOS stable release. AlmaLinux OS is a 1:1 binary compatible fork of RHEL® 8 guided and built by the community. As a standalone, completely free OS, AlmaLinux OS enjoys $1M in annual sponsorship from CloudLinux Inc and support from other sponsors. Ongoing development efforts are governed by the members of the community.” To help allay any fears that Alma/Cloud isn’t mature enough, CloudLinux OS “is a RHEL fork that has been in place for over ten years.”

I’ve downloaded the AlmaLinux ISO and created a VM under Parallels Desktop, and so far it behaves just like CentOS, at least for me. What AlmaLinux lacked was an up-to-date version of Python, so I set about building an alternative installation of Python 3.9.5, the current (as of this posting date) Python release.

Setup

Like every other RHEL 8 and its clones, the base OS isn’t set up to successfully build all of Python, including many of its modules. So the first thing you have to do is install all the various support libraries and several applications that Python needs to build.

Let’s start by installing the following list of libraries. These match what I’ve documented in the past for Ubuntu, except that the package names are different for RHEL/AlmaLinux.

sudo dnf install zlib-devel ncurses-devel gdbm-devel nss-devel openssl-devel readline-devel libffi-devel sqlite-devel bzip2-devel

Next install Tk. This will also pick up Tcl, the dependency.

sudo dnf install tk tk-devel

Install these last bits for some obscure libraries.

sudo dnf install lzma xz-devel

Because I’m also working with PyQt6, I need to install the full Qt tool set. This won’t stop Python from building, but after installing Python 3.9.5 and installing PyQt6, any PyQt code you write won’t run. You need this package for the PyQt6 runtime.

sudo dnf install qt qt5-qtbase-devel

Build

Download the Python source and untar it into some area on your system. In the same folder where you untarred the source, create a build directory, such as build-3.9.5, and change directory (cd) into it. Then run the following to configure the build environment.

../Python-3.9.5/configure --enable-optimizations

When finished, run make, then make altinstall where your new Python will be located in /usr/local/bin.

Install and Test

You’ll need to add /usr/local/bin to your path in your .bashrc. Bring up a new shell, or source ~/.bashrc in your current shell, and you should be able to test Python, python3.9 --version.

References

Red Hat resets CentOS Linux and users are angry – https://www.zdnet.com/article/red-hat-resets-centos-linux-and-users-are-angry/

the death of centos as we know it

If you haven’t read the news already, then here it is: RedHat has declared that CentOS 8 will officially cease at the end of 2021, which is the end of next year. It doesn’t effect me all that much, but I’ve worked at places and on projects that used CentOS as a binary stand-in for official RedHat because they were already pretty Linux savvy and didn’t want to pay a yearly fee for support. This allowed them to deploy as many instances as needed for development and operations, and not give a wit about if they had enough “entitlements” or not to do so. Developing and working on CentOS also gave those down-stream customers who depended on this work and who ran on official RedHat Enterprise Linux the comfort in knowing that binary compatibility between CentOS and RHEL meant no issues when deploying software developed on CentOS onto their RHEL systems.

But no more after the end of 2021.

RedHat decreed this week that regular CentOS would be replaced by CentOS Stream, a rolling distribution of RHEL. That has lit a fire under a whole lot of folk who were depending on CentOS 8 to have a 10-year run, up to the end of 2029, instead of the end of 2021. So anybody who built or is building an important part of their business on top of CentOS has been blown out of the water.

So why did this happen? Here are my personal theories based on the current circumstances. Remember that RedHat is owned by IBM. IBM closed that deal back in July 2019 and paid a princely $34 Billion dollars. Even for IBM that’s a lot of cash, and IBM is going to want a decent ROI, with ‘decent’ defined by IBM. IBM is not going to look kindly on a distribution supported essentially by RedHat, based on RHEL, that nobody pays for. Remember that before IBM acquired RedHat, RedHat started “sponsoring” CentOS and obtained the CentOS trademarks. RedHat essentially purchased CentOS, naming it the CentOS Project. This added to Fedora Linux, RHEL’s upstream development distro. When IBM came along and made its acquisition it gained control of all three.

So what does all this mean?

  • IBM spent $34 Billion to acquire RedHat, which includes RHEL, CentOS, and Fedora Linux. The majority of the money will come from RHEL, meaning paying customers. IBM’s attitude is if you want the stability that RHEL provides, then you need to pay for it. A lot of money has gone into making it stable, even more in marketing it and convincing major Linux users to use RHEL and to pay for RedHat support and services. IBM does not look kindly on those who get a free pass with CentOS.
  • IBM’s attitude is if you want to not pay directly for RHEL, then you can help by being a beta tester. Make no mistake, CentOS Stream is upstream and beta to RHEL. You get to try out all the new and exciting features and report any problems. Sigh me up!
  • Finally, you now have an opportunity to have your GitHub pull request more ‘seriously’ considered, which means you can volunteer to fix issues and be a part of the Open Source Software unpaid legions. Sign me up!

You can talk about RHEL all you want, more out of inertia than any other reason, but at the end of the day it’s all IBM and will remain all IBM until IBM either completely subsumes RedHat et. el., or it sells it on again after stripping out all the good bits.

As for a replacement to CentOS, you might want to look at Oracle Linux. Oracle sees this change to CentOS as a golden opportunity and has thus opened up its distribution. I personally was able to download Oracle Linux 8.3 and spin up a VM using Parallels on my MBP. It was very easy to install and get running, more so than CentOS. And that was no typo. Oracle Linux 8.3 is tracking RHEL, which is also 8.3, a lot faster than CentOS. CentOS didn’t step up to 8.3 until sometime this week (I know this because I ran dnf to update, and pulled down nearly 600 packages. When dnf was finished my CentOS VM was at 8.3.2011).

There is one very good reason to use Oracle Linux, and that’s the version of the kernel it’s using. Right now heavy Linux kernel development is with the 5.x version kernels. Everything earlier than that, such as the 4.x version kernels, are essentially in sustainment. RedHat, and thus CentOS, are using a 4.18 kernel. If you query Oracle Linux, this is what it shows:

[oracle8@oracle8 ~]$ uname -saLinux oracle8 5.4.17-2036.100.6.1.el8uek.x86_64 #2 SMP Thu Oct 29 17:06:00 PDT 2020 x86_64 x86_64 x86_64 GNU/Linux[oracle8@oracle8 ~]$

It’s certainly not the latest 5.x kernel, but it’s both current and stable. The other tools aren’t up to date (for example, Python is version 3.6.8), but I can work around those issues far more easily than swapping out an older kernel for a more up-to-date kernel.

My only qualm with Oracle is that it’s Oracle I’m dealing with, and with great suspicion. I suppose I shouldn’t look a gift horse in the mouth, but I don’t trust Oracle all that much these days because of the way Java has been blown up by them.

There will more than likely be other CentOS replacement distributions if the rage on the various fora are to be believed, and I’m sure there’ll be a number of noble efforts. Unfortunately the Linux road is littered with the rotting carcasses of distributions that were all hailed as Great Ideas, but nothing came of them after a time because of the inertia over keeping with the established players. My advice is if you’re unhappy with CentOS then consider either Ubuntu or Suse. For me the choice is between Ubuntu and Oracle Linux.

Link: https://arstechnica.com/gadgets/2020/12/centos-shifts-from-red-hat-unbranded-to-red-hat-beta/