Thursday, September 3, 2020

updating python to the more recent Python versions packaged for Ubuntu

 


DO NOT FOLLOW THE steps below or it will damage your system 

1) cant log into ubuntu

2) error on apt update

3) terminal will not open 


sudo add-apt-repository ppa:deadsnakes/ppa

[sudo] password for xxx: 

 This PPA contains more recent Python versions packaged for Ubuntu.

https://medium.com/@rajputankit22/upgrade-python-2-7-to-3-6-and-3-7-in-ubuntu-97d2727bf911


This does not remove python 2.7 

sudo apt-get remove python2.7

https://howtoinstall.co/en/ubuntu/xenial/python2.7?action=remove

 $ python

bash: /usr/bin/python: No such file or directory


Python3 is not a drop in replacement for python2. You need a python3 version of lss.

ls -l /usr/bin/python

ls: cannot access '/usr/bin/python': No such file or directory

sudo apt-get install python3
python3 is already the newest version (3.8.2-0ubuntu2)

python3.8
Python 3.8.2 (default, Jul 16 2020, 14:00:26) 
[GCC 9.3.0] on linux

 sudo add-apt-repository --remove ppa:apt-fast
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 12, in <module>
    from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 28, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'


apt-get install python-dev 

Disclaimer: there's no guarantee of timely updates in case of security problems or other issues. If you want to use them in a security-or-otherwise-critical environment (say, on a production server), you do so at your own risk.


Update Note

===========

Please use this repository instead of ppa:fkrull/deadsnakes.


Reporting Issues

================


Issues can be reported in the master issue tracker at:

https://github.com/deadsnakes/issues/issues


Supported Ubuntu and Python Versions

====================================


- Ubuntu 16.04 (xenial) Python 2.3 - Python 2.6, Python 3.1 - Python3.4, Python 3.6 - Python3.9

- Ubuntu 18.04 (bionic) Python2.3 - Python 2.6, Python 3.1 - Python 3.5, Python3.7 - Python3.9

- Ubuntu 20.04 (focal) Python3.5 - Python3.7, Python3.9

- Note: Python2.7 (all), Python 3.5 (xenial), Python 3.6 (bionic), Python 3.8 (focal) are not provided by deadsnakes as upstream ubuntu provides those packages.

- Note: for focal, older python versions require libssl1.0.x so they are not currently built