使用命令:
apt install python3.8
查看python的软连接:
>>> ls -l /usr/bin | grep python -rwxr-xr-x 1 root root 1056 Apr 16 2018 dh_python2 lrwxrwxrwx 1 root root 23 Oct 8 01:39 pdb2.7 -> ../lib/python2.7/pdb.py lrwxrwxrwx 1 root root 23 Oct 7 20:59 pdb3.6 -> ../lib/python3.6/pdb.py lrwxrwxrwx 1 root root 23 Oct 29 00:14 pdb3.8 -> ../lib/python3.8/pdb.py lrwxrwxrwx 1 root root 31 Oct 25 2018 py3versions -> ../share/python3/py3versions.py lrwxrwxrwx 1 root root 9 Apr 16 2018 python -> python2.7 lrwxrwxrwx 1 root root 9 Apr 16 2018 python2 -> python2.7 -rwxr-xr-x 1 root root 3641704 Oct 8 01:39 python2.7 lrwxrwxrwx 1 root root 33 Oct 8 01:39 python2.7-config -> x86_64-linux-gnu-python2.7-config lrwxrwxrwx 1 root root 16 Apr 16 2018 python2-config -> python2.7-config lrwxrwxrwx 1 root root 9 Oct 25 2018 python3 -> python3.6 -rwxr-xr-x 2 root root 4526456 Oct 7 20:59 python3.6 -rwxr-xr-x 2 root root 4526456 Oct 7 20:59 python3.6m -rwxr-xr-x 1 root root 5203488 Oct 29 00:14 python3.8 -rwxr-xr-x 1 root root 1018 Oct 29 2017 python3-jsondiff -rwxr-xr-x 1 root root 3661 Oct 29 2017 python3-jsonpatch -rwxr-xr-x 1 root root 1342 May 2 2016 python3-jsonpointer -rwxr-xr-x 1 root root 398 Nov 16 2017 python3-jsonschema lrwxrwxrwx 1 root root 10 Oct 25 2018 python3m -> python3.6m lrwxrwxrwx 1 root root 16 Apr 16 2018 python-config -> python2.7-config lrwxrwxrwx 1 root root 29 Apr 16 2018 pyversions -> ../share/python/pyversions.py -rwxr-xr-x 1 root root 2971 Oct 8 01:39 x86_64-linux-gnu-python2.7-config lrwxrwxrwx 1 root root 33 Apr 16 2018 x86_64-linux-gnu-python-config -> x86_64-linux-gnu-python2.7-config
rm /usr/bin/python ln -s /usr/bin/python3.7 /usr/bin/python
参考:https://www.jianshu.com/p/fe0b278b8916