Ilovetech
Ilovetech

Reputation: 51

How to upgrade python 3.8.0 to 3.8.3 in ubuntu 18.04

I have Ubuntu 18.04 and I upgraded the python version from 3.6 to 3.8. However the python version it installed was 3.8.0 and I want 3.8.3.

$ sudo python3 --version
Python 3.8.0

How do I upgrade to 3.8.3?

Upvotes: 5

Views: 18008

Answers (4)

dhruv sharma
dhruv sharma

Reputation: 61

I had to upgrade my python package from 3.8.15 to 3.8.17 on ubuntu 22.04 LTS, for that I used the following steps (upgrading a specific python package from the source directly :

  • Update your system's local repository list by running:
sudo apt update
  • Install supporting dependencies on your system with APT:
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
  • change directory to /opt and store the downloaded python source files there:
cd /opt

OR Make a new directory to store the Python source files:

mkdir ./python && cd ./python
  • Download the Python source code from the official FTP server (download here) :
wget https://www.python.org/ftp/python/3.8.17/Python-3.8.17.tgz
  • Extract the TGZ file that you just downloaded with:
tar -xvf Python-3.8.17.tgz
  • You need to perform tests and optimizations before installing Python. This is important as it increases the execution speed of your code by at least 10 percent:
cd Python-3.8.17
./configure --enable-optimizations
  • Build the package using the MakeFile present in the directory:
sudo make install

After you've implemented these steps, check if Python was installed properly on your computer by typing python3 --version in the terminal it should now show 3.8.17.

Hope this helps! Thanks! All credits go to the following blog post from where I got and used this approach (here)

Upvotes: 0

Omkesh Sajjanwar
Omkesh Sajjanwar

Reputation: 843

Update python3 3.6 to python3 3.8 version Steps:

    1. Check python version python3 -V
    1. sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get update
    1. apt-get update
    1. Verify the Python updated or not apt list | grep python3.8
    1. Install the Python 3.8 sudo apt-get install python3.8
    1. sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
    1. sudo update-alternatives --config python3
    1. Now type 2 and hit enter
    1. python3 -V

Now you can see python3 updated with 3.8 version.

Upvotes: 2

wjandrea
wjandrea

Reputation: 32963

You can use the deadsnakes PPA to install it. The latest version for 18.04 is currently 3.8.3-1+bionic1.

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.8

However, you should make sure that python3 points to the system version of Python (i.e. 3.6), since different versions are not alternatives on Ubuntu, and that can break your system (examples 1, 2, 3). You'll need to use python3.8 to run Python 3.8 in the future.

Upvotes: 5

b1nch0
b1nch0

Reputation: 36

as the manual says, compile from source , since deb packaging is a bit behind actual releases

Upvotes: 1

Related Questions