Skip to content

Instantly share code, notes, and snippets.

@BTabaku
Last active March 20, 2024 13:09
Show Gist options
  • Save BTabaku/41f72d9ff56c8d8962a2d7b9065645a0 to your computer and use it in GitHub Desktop.
Save BTabaku/41f72d9ff56c8d8962a2d7b9065645a0 to your computer and use it in GitHub Desktop.
Install/ upgrade python to python3.9 on SUSE 15 linux
#!/bin/bash
sudo zypper refresh
# setup developer tools first if you dont have them already
sudo zypper install gcc zlib-devel bzip2 libbz2-devel libffi-devel libopenssl-devel readline-devel sqlite3 sqlite3-devel xz xz-devel
# Download and install OpenSSL
wget https://www.openssl.org/source/openssl-1.1.1l.tar.gz
tar xvf openssl-1.1.1l.tar.gz
cd openssl-1.1.1l
./config
make
sudo make install
cd ..
# Install the development tools
sudo zypper install -t pattern devel_basis
# Download the Python 3.9 source code
wget --no-check-certificate https://www.python.org/ftp/python/3.9.7/Python-3.9.7.tgz
# Extract the downloaded file
tar xvf Python-3.9.7.tgz
# Navigate to the Python-3.9.7 directory
cd Python-3.9.7
# Configure the build process
./configure --with-ensurepip=install --with-openssl=/usr/local/ssl
# Compile Python source code
make
# Install the Python binary
sudo make install
# Verify the installation
python3.9 --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment