Pages

Search

(Solution) Change python default version (Kali linux)

kali@kali:/bin$ update-alternatives --list python

update-alternatives: error: no alternatives for python

kali@kali:/bin$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1

update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto mode

kali@kali:/bin$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2

update-alternatives: using /usr/bin/python3.7 to provide /usr/bin/python (python) in auto mode

kali@kali:/bin$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 3

update-alternatives: using /usr/bin/python3.8 to provide /usr/bin/python (python) in auto mode

kali@kali:/bin$ sudo update-alternatives --config python 

Finally test everything is ok.