Forked from UbuntuEvangelist/How To Install Python Ubuntu 24.04 LTS
Created
August 25, 2021 18:30
-
-
Save iotonlinux/73542f7540300ed228f76eada131558a to your computer and use it in GitHub Desktop.
How To Install Python-3.8.6 Into Ubuntu 20.04 LTS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/bin/sh | |
sudo apt update | |
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev | |
sudo apt-get install build-essential checkinstall | |
sudo apt autoremove | |
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev | |
cd /opt | |
sudo wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz | |
sudo tar xzf Python-3.8.6.tgz | |
ls -la | |
sudo rm -f Python-3.8.6.tgz | |
cd Python-3.8.6 | |
sudo ./configure --enable-optimizations | |
sudo make altinstall | |
sudo apt-get install python3-pip | |
python3.8 -V | |
sudo 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 | |
python3 --version | |
python --version | |
pip3 --version | |
python3 --version | |
pip --version | |
python --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
cd /opt
sudo wget https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tgz
sudo tar xzf Python-3.9.2.tgz
cd Python-3.9.2
sudo ./configure --enable-optimizations
sudo make altinstall
cd /usr/local/bin/
ls
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.9 2
update-alternatives --list python3
update-alternatives --config python3