Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

debian upgrade python

Install the required dependencies to compile the Python source code.

$ apt-get install wget build-essential libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev liblzma-dev -y

Visit Python's Source Code Download page to find the latest gzipped source release. Replace the URLs and filenames in this guide with the latest version.

Download the latest Python3 source code.

$ wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz

Extract the downloaded python source code archive.

$ tar xzf Python-3.9.6.tgz

Compile the python source code.

$ cd Python-3.9.6 && ./configure --enable-optimizations

Install Python.

$ make altinstall

Check the name of your new Python executable.

$ ls /usr/local/bin/python*

Set the new Python executable as default. Replace the two instances of /python3.9 in the following command with the name of your new Python executable.

$ update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1


Update Pip

Update pip. Use the name of your new Python executable in the following command.

$ /usr/local/bin/python3.9 -m pip install --upgrade pip

Check the name of your new pip executable.

$ ls /usr/local/bin/pip*

Set the new pip as the default. Use the name of your new pip executable in the following command.

$ update-alternatives --install /usr/bin/pip pip /usr/local/bin/pip3.9 1

Check the current version of Python and pip.

$ python -V && pip -V

You will see something like this:

Python 3.9.6
pip 21.2.3 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)
Comment

PREVIOUS NEXT
Code Example
Shell :: git commit message conventions 
Shell :: boucle bash 
Shell :: git config --global user.name "Server" 
Shell :: Invalid base64 sqs 
Shell :: compress folder pigz 
Shell :: kubectl tls skip verify 
Shell :: configurer kdiff3 
Shell :: git view last commits 
Shell :: require php mailer 
Shell :: remove in terminal 
Shell :: change user of a directory in linux 
Shell :: change folder permissions to public linux 
Shell :: install jenkins on ubuntu 20.04 
Shell :: Checking dependencies BASH 
Shell :: cat command in linux 
Shell :: check service status in linux 
Shell :: how to fast mouse scrolling in ubuntu 20.04 
Shell :: centos 7 install docker compose 
Shell :: remove all local changes git 
Shell :: Git config --list to list all the settings 
Shell :: git remove local branch 
Shell :: jq select by field 
Shell :: curl save file 
Shell :: failed to push some refs to 
Shell :: linux alternatives to tree 
Shell :: powershell add line to beginning of file 
Shell :: how to run a .sh file 
Shell :: zip files linux 
Shell :: yarn uninstall 
Shell :: copy ssh key from windows to linux 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =