Thursday, September 3, 2020

python hell in ubuntu

 


  772  sudo add-apt-repository ppa:deadsnakes/ppa

  773  sudo apt-get update

  774  sudo apt-get install python3.6

  775  sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1

  776  python

  777  sudo apt-get remove python2.7

  778  python

  779  python3 lss3

  780  ls -l /usr/bin/python

  781  apt-get install python3

  782  sudo apt-get install python3

  783  sudo apt autoremove

  784  python

  785  python 3.8

  786  python3.8

  787  dpkg -l

  788  sudo apt update

  789  dpgk -i apt

  790  apt-get --reinstall install

  791  sudo apt-get --reinstall install

  792  sudo apt reinstall pkg

  793  sudo apt reinstall apt-pkg

  794  sudo apt reinstall apt_pkg

  795  sudo apt update -fix-missing

  796  sudo apt update --fix-missing

  797  sudo dpkg --configure -a

  798  sudo apt update --fix-missing

  799  sudo apt remove deadsnakes/ppa

  800  sudo apt remove deadsnakes

  801  sudo add-apt-repository --remove ppa:deadsnakes/PPA

  802  sudo apt-get install --reinstall python 3-apt

  803  sudo apt-get install --reinstall python3-apt

  804  sudo apt update

  805  sudo dpkg -r --force-depends apt-package

  806  sudo dpkg -r --force-depends apt-pkg

  807  sudo dpkg -r --force-depends apt_pkg

  808  sudo apt install apt_pkg

  809  sudo apt remove --purge python3-apt

  810  sudo apt update

  811  sudo apt upgrade

  812  sudo apt autoremove

  813  sudo apt update

  814  sudo apt install python3-apt

  815  reboot

  816  sudo ubuntu-drivers devices

  817  sudo dpkg-reconfigure

  818  sudo dpkg-reconfigure gnome

  819  ls -lA

  820  chown computer:computer .Xauthority

  821  chown computer:computer .ICEauthority

  822  startx

  823  sudo startx

  824  quit

  825  exit

  826  sudo apt update

  827  sudo nano /usr/bin/gnome-terminal

  828  sudo apt update

  829  sudo apt dist-upgrade

  830  sudo apt remove ppa:deadsnakes

  831  sudo apt remove deadsnakes/ppa

  832  sudo add-apt-repository --remove ppa:deadsnakes

  833  sudo apt --remove ppa:deadsnakes

  834  sudo apt --remove ppa:deadsnakes/ppa

  835  sudo add-apt-repository --remove ppa:deadsnakes/ppa

  836  sudo apt install ppa-purge

  837  sudo ppa-purge ppa:deadsnakes/ppa

  838  sudo apt update

  839  sudo ppa-purge ppa:apt-fast/ppa

  840  sudo apt --remove apt-fast

  841  sudo apt update

  842  reboot

  843  sudo apt-get install --reinstall update-manager synaptic

  844  sudo dpkg ––configure –a

  845  sudo apt-get install –f

  846  sudo dpkg --configure -a

  847  cd /tmp

  848  sudo apt-get download python3

  849  sudo dpkg -i python3*.deb && apt-get dist-upgrade

  850  sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoremove

  851  sudo apt-get install --fix-broken

  852  sudo apt-get purge python* && sudo apt-get autoclean && sudo apt-get install python*

  853  sudo dpkg-reconfigure python2.7*

  854  sudo apt install python3

  855  sudo apt remove python3

  856  sudo apt autoclean

  857  sudo apt autoupdate

  858  sudo apt update

  859  sudo apt-get purge python* && sudo apt-get autoclean && sudo apt-get install python*

  860  sudo apt install software-properties-common

  861  sudo dpkg –configure -a

  862  sudo apt-get install --fix-broken

  863  sudo apt-get --reinstall install python3

  864  sudo apt-get  -f install

  865  sudo dpkg --configure -a

  866  sudo apt install -f --reinstall python3-minimal

  867  apt-get download python3-minimal

  868  sudo dpkg -i *python3*.deb

  869  sudo apt install -f

  870  history > history_for_print.txt

terminal will not open in ubuntu

 

Press ctrl+alt +F2

log into admin 


sudo nano /usr/bin/gnome-terminal

Then, change:


#!/usr/bin/python3

to


#!/usr/bin/python3.6 or 3.8

https://www.maketecheasier.com/fix-ubuntu-cannot-open-terminal/

Problem executing scripts APT::Update::Post-Invoke-Success

 Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'



sudo apt-get purge libappstream3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libappstream3
https://itectec.com/ubuntu/ubuntu-e-problem-executing-scripts-apt-updatepost-invoke-success-error-during-apt-get-update/

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