To upgrade your python version in Ubuntu 18.10 Following these steps:
omprakash@omprakash:~$ sudo apt-get install python3.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
python3.7-minimal
Suggested packages:
python3.7-venv python3.7-doc binfmt-support
The following NEW packages will be installed:
python3.7 python3.7-minimal
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,944 kB of archives.
After this operation, 10.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 python3.7-minimal amd64 3.7.3-2~18.10 [1,660 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 python3.7 amd64 3.7.3-2~18.10 [284 kB]
Fetched 1,944 kB in 12s (164 kB/s)
Selecting previously unselected package python3.7-minimal.
(Reading database ... 223188 files and directories currently installed.)
Preparing to unpack .../python3.7-minimal_3.7.3-2~18.10_amd64.deb ...
Unpacking python3.7-minimal (3.7.3-2~18.10) ...
Selecting previously unselected package python3.7.
Preparing to unpack .../python3.7_3.7.3-2~18.10_amd64.deb ...
Unpacking python3.7 (3.7.3-2~18.10) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-3ubuntu3) ...
Setting up python3.7-minimal (3.7.3-2~18.10) ...
Processing triggers for man-db (2.8.4-2) ...
Setting up python3.7 (3.7.3-2~18.10) ...
omprakash@omprakash:~$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
update-alternatives: using /usr/bin/python3.6 to provide /usr/bin/python3 (python3) in auto mode
omprakash@omprakash:~$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2
update-alternatives: using /usr/bin/python3.7 to provide /usr/bin/python3 (python3) in auto mode
omprakash@omprakash:~$ sudo update-alternatives --config python3
There are 2 choices for the alternative python3 (providing /usr/bin/python3).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/python3.7 2 auto mode
1 /usr/bin/python3.6 1 manual mode
2 /usr/bin/python3.7 2 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
omprakash@omprakash:~$ python3 -V
Python 3.7.3
omprakash@omprakash:~$ python2 -V
Python 2.7.16
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
python3.7-minimal
Suggested packages:
python3.7-venv python3.7-doc binfmt-support
The following NEW packages will be installed:
python3.7 python3.7-minimal
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,944 kB of archives.
After this operation, 10.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 python3.7-minimal amd64 3.7.3-2~18.10 [1,660 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 python3.7 amd64 3.7.3-2~18.10 [284 kB]
Fetched 1,944 kB in 12s (164 kB/s)
Selecting previously unselected package python3.7-minimal.
(Reading database ... 223188 files and directories currently installed.)
Preparing to unpack .../python3.7-minimal_3.7.3-2~18.10_amd64.deb ...
Unpacking python3.7-minimal (3.7.3-2~18.10) ...
Selecting previously unselected package python3.7.
Preparing to unpack .../python3.7_3.7.3-2~18.10_amd64.deb ...
Unpacking python3.7 (3.7.3-2~18.10) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-3ubuntu3) ...
Setting up python3.7-minimal (3.7.3-2~18.10) ...
Processing triggers for man-db (2.8.4-2) ...
Setting up python3.7 (3.7.3-2~18.10) ...
omprakash@omprakash:~$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1
update-alternatives: using /usr/bin/python3.6 to provide /usr/bin/python3 (python3) in auto mode
omprakash@omprakash:~$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2
update-alternatives: using /usr/bin/python3.7 to provide /usr/bin/python3 (python3) in auto mode
omprakash@omprakash:~$ sudo update-alternatives --config python3
There are 2 choices for the alternative python3 (providing /usr/bin/python3).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/python3.7 2 auto mode
1 /usr/bin/python3.6 1 manual mode
2 /usr/bin/python3.7 2 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
omprakash@omprakash:~$ python3 -V
Python 3.7.3
omprakash@omprakash:~$ python2 -V
Python 2.7.16
Comments
Post a Comment
thank you for visiting :)