Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LinuxFintech/7c135581f8076d645e3e1093c441ac33 to your computer and use it in GitHub Desktop.
Save LinuxFintech/7c135581f8076d645e3e1093c441ac33 to your computer and use it in GitHub Desktop.
Install Python-3.9.9 Into Ubuntu 20.04 LTS
# !/bin/sh
sudo -i
apt update && apt upgrade -y
apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev
apt install build-essential checkinstall
apt autoremove
apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
cd /opt
wget https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz
tar xzf Python-3.9.9.tgz
ls -la
rm -f Python-3.9.9.tgz
cd Python-3.9.9
./configure --enable-optimizations
make altinstall
apt install python3-pip
cd
nano ~/.bashrc
# Add into the bottom
alias python=python3
alias pip=pip3
# Save & Exit ctrl+s and ctrl+x
alias python=python3
alias pip=pip3
source ~/.bashrc
sudo apt update
sudo apt upgrade -y
python --version
pip --version
Session Outputs Videos Terminal Commands
#########################################
lsb_release -a
uname -a
whoami
w
python --version
pip --version
apt update -y
apt upgrade -y
apt update -y
update-alternatives --config python3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment