Redhat / CentOS 6.x users need python 2.7


#1

Seeing as a few Redhat and CentOS 6.x users have been caught by Letsencrypt’s client requirements for Python 2.7, I decided to post a dedicated thread for installing Python 2.7 beside RHEL/CentOS 6.x default Python 2.6. CentOS/RHEL 7 users are fine as Python 2.7 is default unlike CentOS/RHEL 6.x default Python 2.6.

CentOS 6.x runs python 2.6.6 but letsencrypt client requires python 2.7 https://github.com/letsencrypt/letsencrypt/issues/1106

Update: Letsencrypt client re-added Python 2.6 support. However Centos 6.x at least doesn’t have python-virtualenv package, so requires EPEL yum repo for it https://github.com/letsencrypt/letsencrypt/pull/1241

For centos 6, you can install python 2.7 besides python 2.6 via IUS Community yum repo https://ius.io/GettingStarted/ and then install python 2.7

yum -y install python27 python27-devel python27-pip python27-setuptools python27-virtualenv --enablerepo=ius

then do what i do and replace python2 with python 2.7 in letsencrypt-auto script

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
sed -i "s|--python python2|--python python2.7|" letsencrypt-auto
./letsencrypt-auto --verbose

Hope that helps folks :slight_smile:

threads of reference


CentOS 6.7 runs Python2.6.6 installed Python2.7.6 how to call during letsencrypt-auto?
A tutorial to start with CentOS 6.5?
Over simplified instructions .. more details?
Missing/old python Version on Centos
Problem installing letsencrypt on Centos 6 web and mail server
How to install Let's Encrypt SSL certs for GoDaddy's VPS / WHM / cPanel
How to make Certbot-auto to use python 2.7?
#2

Might also be possible w/o the IUS repo :

yum install centos-release-SCL
yum install python27 python27-python-devel python27-python-setuptools python27-python-tools python27-python-virtualenv

https://wiki.centos.org/AdditionalResources/Repositories/SCL

*did not try, not part of beta, yet! :wink:


#3

cheers @svennd more than one way to install Python 2.7 :slight_smile:


Letsencrypt Webroot Authentication Tested on Beta invited/whitelisted domain
#4

heads up folks on CentOS/RHEL 6 might want to read or provide their input on https://github.com/letsencrypt/letsencrypt/pull/1172


#5

Also EPEL yum repo seems to be required for CentOS 6 https://github.com/letsencrypt/letsencrypt/issues/1204#issuecomment-152664407 for python-virtualenv package not that it matters as that is python 2.6 based not python 2.7 based


#6

Also, I had to remove old letsencrypt files to be able to use new python version:

rm -Rf /root/.local/share/letsencrypt

I also run this command:

alias python=python2.7

To make sure everything will be run under python 2.7 :smile:


#7

I tried this on Amazon Linux, which is a RHEL/Centos6 distro. I didn’t need to use any external repos to install Python 2.7 and python -V returns 2.7.10… but when I try to run the letsencrypt install, I get this…

Sorry, I don’t know how to bootstrap Let’s Encrypt on your operating system!

You will need to bootstrap, configure virtualenv, and run a pip install manually
Please see https://letsencrypt.readthedocs.org/en/latest/contributing.html#prerequisites
for more info
WARNING: Python 2.6 support is very experimental at present…
if you would like to work on improving it, please ensure you have backups
and then run this script again with the --debug flag!

:frowning:


#8

does your system have python-virtualenv yum package ? centos 6.x at least doesn’t so requires EPEL yum repo for it https://github.com/letsencrypt/letsencrypt/pull/1241


#9

I also have CentOS 6. (There is a huge installed base of CentOS6, I have a feeling this is goign to be a common problem)

I have installed python 2.7 and set it up as the default python

‘# alias python=/usr/local/bin/python2.7
’# python --version
Python 2.7.6

When I run the following:
./letsencrypt-auto --help

I get the following. Can someone explain what’s going on here?

Bootstrapping dependencies for RedHat-based OSes…
yum is /usr/bin/yum
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Package python-2.6.6-64.el6.x86_64 already installed and latest version
Package python-devel-2.6.6-64.el6.x86_64 already installed and latest version
No package python-virtualenv available.
Nothing to do
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Package git-1.7.1-3.el6_4.1.x86_64 already installed and latest version
Package gcc-4.4.7-16.el6.x86_64 already installed and latest version
Package dialog-1.1-9.20080819.1.el6.x86_64 already installed and latest version
Package augeas-libs-1.0.0-10.el6.x86_64 already installed and latest version
Package openssl-devel-1.0.1e-42.el6.x86_64 already installed and latest version
Package libffi-devel-3.0.5-3.2.el6.x86_64 already installed and latest version
Package redhat-rpm-config-9.0.3-44.el6.centos.noarch already installed and latest version
Package ca-certificates-2015.2.4-65.0.1.el6_6.noarch already installed and latest version
Nothing to do
WARNING: Python 2.6 support is very experimental at present…
if you would like to work on improving it, please ensure you have backups
and then run this script again with the --debug flag!


#10

i don’t use alias method, i just use the method outlined in 1st post with IUS Community repo and sed replacement


#11

Hello @pfreet,
Here’s what I did to get it working on Amazon’s Linux AMI:

:sunglasses: Good luck!


#12

I solved this problem using Software Collections on CentOS 6. It is an elegant solution similar to what some others have posted here.

https://thelastcicada.com/solving-the-python-2-6-issue-for-letencrypt-on-centos-6

Basic concept is

  1. Install Software Collections yum install centos-release-SCL

  2. Install Python 2.7 yum install python27

  3. Run LetsEncrypt via Software Collections scl enable python27 "/root/letsencrypt/letsencrypt-auto certonly --agree-tos --webroot --webroot-path /var/www/html/mywebsite.com -d mywebsite.com"


#13

@TheLastCicada Brilliant. Thank you.


#14

No need to run alias here, but removing the /root/.local/share/letsencrypt folder was essential Cheers


#16