Skip to content

Instantly share code, notes, and snippets.

@bobby569
Created May 28, 2021 21:42
Show Gist options
  • Select an option

  • Save bobby569/a64325fa467143850d2b7976e639c6fd to your computer and use it in GitHub Desktop.

Select an option

Save bobby569/a64325fa467143850d2b7976e639c6fd to your computer and use it in GitHub Desktop.
Scripts to install python on linux
#!/bin/bash
VERSION=$1
sudo apt update
sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl libbz2-dev
curl -O https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz
tar -xf Python-$VERSION.tar.xz
cd Python-$VERSION
./configure --enable-optimizations
make -j 8 # number of core, 8 by default
sudo make altinstall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment