yangguang@yangguang-virtual-machine:~$ python --version
Python 2.7.17
yangguang@yangguang-virtual-machine:~$ python3 --version
Python 3.6.9
yangguang@yangguang-virtual-machine:~$ python2 --version
Python 2.7.17
yangguang@yangguang-virtual-machine:~$ sudo apt update
[sudo] yangguang 的密码:
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
获取:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease [109 kB]
获取:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease [107 kB]
命中:4 http://archive.ubuntu.com/ubuntu xenial InRelease
命中:5 http://archive.canonical.com/ubuntu xenial InRelease
获取:6 http://mirrors.aliyun.com/ubuntu xenial-security InRelease [109 kB]
忽略:7 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
获取:8 http://mirrors.aliyun.com/ubuntu xenial-updates/universe Sources [269 kB]
获取:9 http://mirrors.aliyun.com/ubuntu xenial-updates/main Sources [347 kB]
获取:10 http://mirrors.aliyun.com/ubuntu xenial-updates/main i386 Packages [923 kB]
获取:11 http://mirrors.aliyun.com/ubuntu xenial-updates/main amd64 Packages [1,149 kB]
错误:12 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
获取:13 http://mirrors.aliyun.com/ubuntu xenial-updates/main Translation-en [434 kB]
获取:14 http://mirrors.aliyun.com/ubuntu xenial-updates/main amd64 DEP-11 Metadata [324 kB]
获取:15 http://mirrors.aliyun.com/ubuntu xenial-updates/universe i386 Packages [721 kB]
获取:16 http://mirrors.aliyun.com/ubuntu xenial-updates/universe amd64 Packages [798 kB]
获取:17 http://mirrors.aliyun.com/ubuntu xenial-updates/universe Translation-en [334 kB]
获取:18 http://mirrors.aliyun.com/ubuntu xenial-updates/universe amd64 DEP-11 Metadata [276 kB]
获取:19 http://mirrors.aliyun.com/ubuntu xenial-updates/universe DEP-11 64x64 Icons [405 kB]
获取:20 http://mirrors.aliyun.com/ubuntu xenial-updates/multiverse amd64 DEP-11 Metadata [5,960 B]
获取:21 http://mirrors.aliyun.com/ubuntu xenial-backports/main amd64 DEP-11 Metadata [3,328 B]
获取:22 http://mirrors.aliyun.com/ubuntu xenial-backports/universe amd64 DEP-11 Metadata [5,320 B]
获取:23 http://mirrors.aliyun.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [76.7 kB]
获取:24 http://mirrors.aliyun.com/ubuntu xenial-security/universe amd64 DEP-11 Metadata [124 kB]
获取:25 http://mirrors.aliyun.com/ubuntu xenial-security/multiverse amd64 DEP-11 Metadata [2,464 B]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
yangguang@yangguang-virtual-machine:~$ sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libness3-dev libssl-dev libreadline-dev libffi-dev wget
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
E: 无法定位软件包 libness3-dev
yangguang@yangguang-virtual-machine:~$ wget https://www.python.org/ftp/python/3.8,0/Python-3.8.0.tgz
--2020-05-19 10:27:17-- https://www.python.org/ftp/python/3.8,0/Python-3.8.0.tgz
正在解析主机 www.python.org (www.python.org)... 151.101.108.223, 2a04:4e42:1a::223
正在连接 www.python.org (www.python.org)|151.101.108.223|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 404 Not Found
2020-05-19 10:27:18 错误 404:Not Found。
yangguang@yangguang-virtual-machine:~$ su
密码:
root@yangguang-virtual-machine:/home/yangguang# sudo apt update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
命中:5 http://archive.canonical.com/ubuntu xenial InRelease
忽略:6 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
命中:7 http://archive.ubuntu.com/ubuntu xenial InRelease
错误:8 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
root@yangguang-virtual-machine:/home/yangguang# sudo apt install software-properties-common
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
software-properties-common 已经是最新版 (0.96.24.32.7)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
root@yangguang-virtual-machine:/home/yangguang# sudo add-apt-repository ppa:deadsnakes/ppa
This PPA contains more recent Python versions packaged for Ubuntu.
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
The packages may also work on other versions of Ubuntu or Debian, but that is not tested or supported.
Packages
========
The packages provided here are loosely based on the debian upstream packages with some modifications to make them more usable as non-default pythons and on ubuntu. As such, the packages follow debian's patterns and often do not include a full python distribution with just `apt install python#.#`. Here is a list of packages that may be useful along with the default install:
- `python#.#-dev`: includes development headers for building C extensions
- `python#.#-venv`: provides the standard library `venv` module
- `python#.#-distutils`: provides the standard library `distutils` module
- `python#.#-lib2to3`: provides the `2to3-#.#` utility as well as the standard library `lib2to3` module
- `python#.#-gdbm`: provides the standard library `gnu.dbm` module
- `python#.#-tk`: provides the standard library `tkinter` module
Third-Party Python Modules
==========================
Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.
To install 3rd-party Python modules, you should use the common Python packaging tools. For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/
Sources
=======
The package sources are available at:
https://github.com/deadsnakes/
更多信息: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
按 [ENTER] 继续或 Ctrl-c 取消安装。
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
忽略:5 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
命中:6 http://archive.ubuntu.com/ubuntu xenial InRelease
命中:7 http://archive.canonical.com/ubuntu xenial InRelease
获取:8 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease [15.9 kB]
错误:9 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
获取:10 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main i386 Packages [30.7 kB]
获取:11 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 Packages [30.7 kB]
获取:12 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main Translation-en [7,064 B]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
root@yangguang-virtual-machine:/home/yangguang# sudo apt install python3.8
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会同时安装下列软件:
libpython3.8-minimal libpython3.8-stdlib python3.8-minimal
建议安装:
python3.8-venv python3.8-doc binfmt-support
下列【新】软件包将被安装:
libpython3.8-minimal libpython3.8-stdlib python3.8 python3.8-minimal
升级了 0 个软件包,新安装了 4 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
需要下载 4,761 kB 的归档。
解压缩后会消耗 18.7 MB 的额外空间。
您希望继续执行吗? [Y/n] Y
获取:1 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 libpython3.8-minimal amd64 3.8.3-1+bionic1 [761 kB]
获取:2 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 python3.8-minimal amd64 3.8.3-1+bionic1 [1,888 kB]
获取:3 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 libpython3.8-stdlib amd64 3.8.3-1+bionic1 [1,699 kB]
获取:4 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 python3.8 amd64 3.8.3-1+bionic1 [414 kB]
已下载 4,761 kB,耗时 26秒 (180 kB/s)
正在选中未选择的软件包 libpython3.8-minimal:amd64。
(正在读取数据库 ... 系统当前共安装有 175582 个文件和目录。)
正准备解包 .../libpython3.8-minimal_3.8.3-1+bionic1_amd64.deb ...
正在解包 libpython3.8-minimal:amd64 (3.8.3-1+bionic1) ...
正在选中未选择的软件包 python3.8-minimal。
正准备解包 .../python3.8-minimal_3.8.3-1+bionic1_amd64.deb ...
正在解包 python3.8-minimal (3.8.3-1+bionic1) ...
正在选中未选择的软件包 libpython3.8-stdlib:amd64。
正准备解包 .../libpython3.8-stdlib_3.8.3-1+bionic1_amd64.deb ...
正在解包 libpython3.8-stdlib:amd64 (3.8.3-1+bionic1) ...
正在选中未选择的软件包 python3.8。
正准备解包 .../python3.8_3.8.3-1+bionic1_amd64.deb ...
正在解包 python3.8 (3.8.3-1+bionic1) ...
正在设置 libpython3.8-minimal:amd64 (3.8.3-1+bionic1) ...
正在处理用于 mime-support (3.60ubuntu1) 的触发器 ...
正在处理用于 desktop-file-utils (0.23-1ubuntu3.18.04.2) 的触发器 ...
正在设置 python3.8-minimal (3.8.3-1+bionic1) ...
正在处理用于 man-db (2.8.3-2ubuntu0.1) 的触发器 ...
正在处理用于 gnome-menus (3.13.3-11ubuntu1.1) 的触发器 ...
正在设置 libpython3.8-stdlib:amd64 (3.8.3-1+bionic1) ...
正在设置 python3.8 (3.8.3-1+bionic1) ...
root@yangguang-virtual-machine:/home/yangguang# python3.8 --version
Python 3.8.3
root@yangguang-virtual-machine:/home/yangguang# python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@yangguang-virtual-machine:/home/yangguang# python3 --version
Python 3.6.9
root@yangguang-virtual-machine:/home/yangguang# apt update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://archive.ubuntu.com/ubuntu xenial InRelease
命中:5 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
忽略:6 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
命中:7 http://archive.canonical.com/ubuntu xenial InRelease
命中:8 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease
错误:9 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
root@yangguang-virtual-machine:/home/yangguang# apt install software-properties-common
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
software-properties-common 已经是最新版 (0.96.24.32.7)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
root@yangguang-virtual-machine:/home/yangguang# apt update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
忽略:5 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
命中:6 http://archive.ubuntu.com/ubuntu xenial InRelease
命中:7 http://archive.canonical.com/ubuntu xenial InRelease
命中:8 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease
错误:9 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
root@yangguang-virtual-machine:/home/yangguang# remove-apt-repository ppa:deadsnakes/ppa
remove-apt-repository:未找到命令
root@yangguang-virtual-machine:/home/yangguang# add-apt-repository --remove ppa:deadsnakes/ppa
This PPA contains more recent Python versions packaged for Ubuntu.
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
The packages may also work on other versions of Ubuntu or Debian, but that is not tested or supported.
Packages
========
The packages provided here are loosely based on the debian upstream packages with some modifications to make them more usable as non-default pythons and on ubuntu. As such, the packages follow debian's patterns and often do not include a full python distribution with just `apt install python#.#`. Here is a list of packages that may be useful along with the default install:
- `python#.#-dev`: includes development headers for building C extensions
- `python#.#-venv`: provides the standard library `venv` module
- `python#.#-distutils`: provides the standard library `distutils` module
- `python#.#-lib2to3`: provides the `2to3-#.#` utility as well as the standard library `lib2to3` module
- `python#.#-gdbm`: provides the standard library `gnu.dbm` module
- `python#.#-tk`: provides the standard library `tkinter` module
Third-Party Python Modules
==========================
Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.
To install 3rd-party Python modules, you should use the common Python packaging tools. For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/
Sources
=======
The package sources are available at:
https://github.com/deadsnakes/
更多信息: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
按 [ENTER] 继续或Ctrl-c 取消卸载。
root@yangguang-virtual-machine:/home/yangguang# apt update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
命中:5 http://archive.canonical.com/ubuntu xenial InRelease
命中:6 http://archive.ubuntu.com/ubuntu xenial InRelease
忽略:7 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
错误:8 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
root@yangguang-virtual-machine:/home/yangguang# apt install software-properties-common
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
software-properties-common 已经是最新版 (0.96.24.32.7)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
root@yangguang-virtual-machine:/home/yangguang# cd etc/apt
bash: cd: etc/apt: 没有那个文件或目录
root@yangguang-virtual-machine:/home/yangguang# cd ~/etc/apt
bash: cd: /root/etc/apt: 没有那个文件或目录
root@yangguang-virtual-machine:/home/yangguang# cd /home/etc/apt
bash: cd: /home/etc/apt: 没有那个文件或目录
root@yangguang-virtual-machine:/home/yangguang# cd /etc/apt/sources.list.d
root@yangguang-virtual-machine:/etc/apt/sources.list.d# rm *
root@yangguang-virtual-machine:/etc/apt/sources.list.d# apt update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
命中:5 http://archive.ubuntu.com/ubuntu xenial InRelease
命中:6 http://archive.canonical.com/ubuntu xenial InRelease
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
有 5 个软件包可以升级。请执行 ‘apt list --upgradable’ 来查看它们。
root@yangguang-virtual-machine:/etc/apt/sources.list.d# apt install software-properties-common
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
software-properties-common 已经是最新版 (0.96.24.32.7)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
root@yangguang-virtual-machine:/etc/apt/sources.list.d# apt install python3.7
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
注意,根据正则表达式 'python3.7' 选中了 'python3.7-gdbm'
注意,选中 'python3-gdbm' 而非 'python3.7-gdbm'
python3-gdbm 已经是最新版 (3.6.7-1~18.04)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
root@yangguang-virtual-machine:/etc/apt/sources.list.d# apt install python3.8
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
python3.8 已经是最新版 (3.8.3-1+bionic1)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
root@yangguang-virtual-machine:/etc/apt/sources.list.d# python3.8 --version
Python 3.8.3
root@yangguang-virtual-machine:/etc/apt/sources.list.d# whereis python
python: /usr/bin/python2.7 /usr/bin/python3.6 /usr/bin/python3.8 /usr/bin/python3.6m /usr/bin/python /usr/lib/python2.7 /usr/lib/python3.6 /usr/lib/python3.7 /usr/lib/python3.8 /etc/python2.7 /etc/python3.6 /etc/python3.8 /etc/python /usr/local/lib/python2.7 /usr/local/lib/python3.6 /usr/local/lib/python3.8 /usr/include/python3.6m /usr/share/python /usr/share/man/man1/python.1.gz
root@yangguang-virtual-machine:/etc/apt/sources.list.d# python
Python 2.7.17 (default, Apr 15 2020, 17:20:14)
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@yangguang-virtual-machine:/etc/apt/sources.list.d# python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@yangguang-virtual-machine:/etc/apt/sources.list.d# python3.8
Python 3.8.3 (default, May 14 2020, 20:11:43)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@yangguang-virtual-machine:/etc/apt/sources.list.d#
yangguang@yangguang-virtual-machine:~$ python --version
Python 2.7.17
yangguang@yangguang-virtual-machine:~$ python3 --version
Python 3.6.9
yangguang@yangguang-virtual-machine:~$ python2 --version
Python 2.7.17
yangguang@yangguang-virtual-machine:~$ sudo apt update
[sudo] yangguang 的密码:
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
获取:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease [109 kB]
获取:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease [107 kB]
命中:4 http://archive.ubuntu.com/ubuntu xenial InRelease
命中:5 http://archive.canonical.com/ubuntu xenial InRelease
获取:6 http://mirrors.aliyun.com/ubuntu xenial-security InRelease [109 kB]
忽略:7 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
获取:8 http://mirrors.aliyun.com/ubuntu xenial-updates/universe Sources [269 kB]
获取:9 http://mirrors.aliyun.com/ubuntu xenial-updates/main Sources [347 kB]
获取:10 http://mirrors.aliyun.com/ubuntu xenial-updates/main i386 Packages [923 kB]
获取:11 http://mirrors.aliyun.com/ubuntu xenial-updates/main amd64 Packages [1,149 kB]
错误:12 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
获取:13 http://mirrors.aliyun.com/ubuntu xenial-updates/main Translation-en [434 kB]
获取:14 http://mirrors.aliyun.com/ubuntu xenial-updates/main amd64 DEP-11 Metadata [324 kB]
获取:15 http://mirrors.aliyun.com/ubuntu xenial-updates/universe i386 Packages [721 kB]
获取:16 http://mirrors.aliyun.com/ubuntu xenial-updates/universe amd64 Packages [798 kB]
获取:17 http://mirrors.aliyun.com/ubuntu xenial-updates/universe Translation-en [334 kB]
获取:18 http://mirrors.aliyun.com/ubuntu xenial-updates/universe amd64 DEP-11 Metadata [276 kB]
获取:19 http://mirrors.aliyun.com/ubuntu xenial-updates/universe DEP-11 64x64 Icons [405 kB]
获取:20 http://mirrors.aliyun.com/ubuntu xenial-updates/multiverse amd64 DEP-11 Metadata [5,960 B]
获取:21 http://mirrors.aliyun.com/ubuntu xenial-backports/main amd64 DEP-11 Metadata [3,328 B]
获取:22 http://mirrors.aliyun.com/ubuntu xenial-backports/universe amd64 DEP-11 Metadata [5,320 B]
获取:23 http://mirrors.aliyun.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [76.7 kB]
获取:24 http://mirrors.aliyun.com/ubuntu xenial-security/universe amd64 DEP-11 Metadata [124 kB]
获取:25 http://mirrors.aliyun.com/ubuntu xenial-security/multiverse amd64 DEP-11 Metadata [2,464 B]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
yangguang@yangguang-virtual-machine:~$ sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libness3-dev libssl-dev libreadline-dev libffi-dev wget
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
E: 无法定位软件包 libness3-dev
yangguang@yangguang-virtual-machine:~$ wget https://www.python.org/ftp/python/3.8,0/Python-3.8.0.tgz
--2020-05-19 10:27:17-- https://www.python.org/ftp/python/3.8,0/Python-3.8.0.tgz
正在解析主机 www.python.org (www.python.org)... 151.101.108.223, 2a04:4e42:1a::223
正在连接 www.python.org (www.python.org)|151.101.108.223|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 404 Not Found
2020-05-19 10:27:18 错误 404:Not Found。
yangguang@yangguang-virtual-machine:~$ su
密码:
root@yangguang-virtual-machine:/home/yangguang# sudo apt update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
命中:5 http://archive.canonical.com/ubuntu xenial InRelease
忽略:6 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
命中:7 http://archive.ubuntu.com/ubuntu xenial InRelease
错误:8 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
root@yangguang-virtual-machine:/home/yangguang# sudo apt install software-properties-common
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
software-properties-common 已经是最新版 (0.96.24.32.7)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
root@yangguang-virtual-machine:/home/yangguang# sudo add-apt-repository ppa:deadsnakes/ppa
This PPA contains more recent Python versions packaged for Ubuntu.
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
The packages may also work on other versions of Ubuntu or Debian, but that is not tested or supported.
Packages
========
The packages provided here are loosely based on the debian upstream packages with some modifications to make them more usable as non-default pythons and on ubuntu. As such, the packages follow debian's patterns and often do not include a full python distribution with just `apt install python#.#`. Here is a list of packages that may be useful along with the default install:
- `python#.#-dev`: includes development headers for building C extensions
- `python#.#-venv`: provides the standard library `venv` module
- `python#.#-distutils`: provides the standard library `distutils` module
- `python#.#-lib2to3`: provides the `2to3-#.#` utility as well as the standard library `lib2to3` module
- `python#.#-gdbm`: provides the standard library `gnu.dbm` module
- `python#.#-tk`: provides the standard library `tkinter` module
Third-Party Python Modules
==========================
Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.
To install 3rd-party Python modules, you should use the common Python packaging tools. For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/
Sources
=======
The package sources are available at:
https://github.com/deadsnakes/
更多信息: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
按 [ENTER] 继续或 Ctrl-c 取消安装。
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
忽略:5 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
命中:6 http://archive.ubuntu.com/ubuntu xenial InRelease
命中:7 http://archive.canonical.com/ubuntu xenial InRelease
获取:8 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease [15.9 kB]
错误:9 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
获取:10 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main i386 Packages [30.7 kB]
获取:11 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 Packages [30.7 kB]
获取:12 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main Translation-en [7,064 B]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
root@yangguang-virtual-machine:/home/yangguang# sudo apt install python3.8
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会同时安装下列软件:
libpython3.8-minimal libpython3.8-stdlib python3.8-minimal
建议安装:
python3.8-venv python3.8-doc binfmt-support
下列【新】软件包将被安装:
libpython3.8-minimal libpython3.8-stdlib python3.8 python3.8-minimal
升级了 0 个软件包,新安装了 4 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
需要下载 4,761 kB 的归档。
解压缩后会消耗 18.7 MB 的额外空间。
您希望继续执行吗? [Y/n] Y
获取:1 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 libpython3.8-minimal amd64 3.8.3-1+bionic1 [761 kB]
获取:2 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 python3.8-minimal amd64 3.8.3-1+bionic1 [1,888 kB]
获取:3 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 libpython3.8-stdlib amd64 3.8.3-1+bionic1 [1,699 kB]
获取:4 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic/main amd64 python3.8 amd64 3.8.3-1+bionic1 [414 kB]
已下载 4,761 kB,耗时 26秒 (180 kB/s)
正在选中未选择的软件包 libpython3.8-minimal:amd64。
(正在读取数据库 ... 系统当前共安装有 175582 个文件和目录。)
正准备解包 .../libpython3.8-minimal_3.8.3-1+bionic1_amd64.deb ...
正在解包 libpython3.8-minimal:amd64 (3.8.3-1+bionic1) ...
正在选中未选择的软件包 python3.8-minimal。
正准备解包 .../python3.8-minimal_3.8.3-1+bionic1_amd64.deb ...
正在解包 python3.8-minimal (3.8.3-1+bionic1) ...
正在选中未选择的软件包 libpython3.8-stdlib:amd64。
正准备解包 .../libpython3.8-stdlib_3.8.3-1+bionic1_amd64.deb ...
正在解包 libpython3.8-stdlib:amd64 (3.8.3-1+bionic1) ...
正在选中未选择的软件包 python3.8。
正准备解包 .../python3.8_3.8.3-1+bionic1_amd64.deb ...
正在解包 python3.8 (3.8.3-1+bionic1) ...
正在设置 libpython3.8-minimal:amd64 (3.8.3-1+bionic1) ...
正在处理用于 mime-support (3.60ubuntu1) 的触发器 ...
正在处理用于 desktop-file-utils (0.23-1ubuntu3.18.04.2) 的触发器 ...
正在设置 python3.8-minimal (3.8.3-1+bionic1) ...
正在处理用于 man-db (2.8.3-2ubuntu0.1) 的触发器 ...
正在处理用于 gnome-menus (3.13.3-11ubuntu1.1) 的触发器 ...
正在设置 libpython3.8-stdlib:amd64 (3.8.3-1+bionic1) ...
正在设置 python3.8 (3.8.3-1+bionic1) ...
root@yangguang-virtual-machine:/home/yangguang# python3.8 --version
Python 3.8.3
root@yangguang-virtual-machine:/home/yangguang# python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@yangguang-virtual-machine:/home/yangguang# python3 --version
Python 3.6.9
root@yangguang-virtual-machine:/home/yangguang# apt update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://archive.ubuntu.com/ubuntu xenial InRelease
命中:5 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
忽略:6 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
命中:7 http://archive.canonical.com/ubuntu xenial InRelease
命中:8 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease
错误:9 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
root@yangguang-virtual-machine:/home/yangguang# apt install software-properties-common
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
software-properties-common 已经是最新版 (0.96.24.32.7)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
root@yangguang-virtual-machine:/home/yangguang# apt update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
忽略:5 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
命中:6 http://archive.ubuntu.com/ubuntu xenial InRelease
命中:7 http://archive.canonical.com/ubuntu xenial InRelease
命中:8 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease
错误:9 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
root@yangguang-virtual-machine:/home/yangguang# remove-apt-repository ppa:deadsnakes/ppa
remove-apt-repository:未找到命令
root@yangguang-virtual-machine:/home/yangguang# add-apt-repository --remove ppa:deadsnakes/ppa
This PPA contains more recent Python versions packaged for Ubuntu.
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
The packages may also work on other versions of Ubuntu or Debian, but that is not tested or supported.
Packages
========
The packages provided here are loosely based on the debian upstream packages with some modifications to make them more usable as non-default pythons and on ubuntu. As such, the packages follow debian's patterns and often do not include a full python distribution with just `apt install python#.#`. Here is a list of packages that may be useful along with the default install:
- `python#.#-dev`: includes development headers for building C extensions
- `python#.#-venv`: provides the standard library `venv` module
- `python#.#-distutils`: provides the standard library `distutils` module
- `python#.#-lib2to3`: provides the `2to3-#.#` utility as well as the standard library `lib2to3` module
- `python#.#-gdbm`: provides the standard library `gnu.dbm` module
- `python#.#-tk`: provides the standard library `tkinter` module
Third-Party Python Modules
==========================
Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.
To install 3rd-party Python modules, you should use the common Python packaging tools. For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/
Sources
=======
The package sources are available at:
https://github.com/deadsnakes/
更多信息: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
按 [ENTER] 继续或Ctrl-c 取消卸载。
root@yangguang-virtual-machine:/home/yangguang# apt update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
命中:5 http://archive.canonical.com/ubuntu xenial InRelease
命中:6 http://archive.ubuntu.com/ubuntu xenial InRelease
忽略:7 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic InRelease
错误:8 http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
正在读取软件包列表... 完成
E: 仓库 “http://ppa.launchpad.net/damien-moore/codeblocks-stable/ubuntu bionic Release” 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
root@yangguang-virtual-machine:/home/yangguang# apt install software-properties-common
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
software-properties-common 已经是最新版 (0.96.24.32.7)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
root@yangguang-virtual-machine:/home/yangguang# cd etc/apt
bash: cd: etc/apt: 没有那个文件或目录
root@yangguang-virtual-machine:/home/yangguang# cd ~/etc/apt
bash: cd: /root/etc/apt: 没有那个文件或目录
root@yangguang-virtual-machine:/home/yangguang# cd /home/etc/apt
bash: cd: /home/etc/apt: 没有那个文件或目录
root@yangguang-virtual-machine:/home/yangguang# cd /etc/apt/sources.list.d
root@yangguang-virtual-machine:/etc/apt/sources.list.d# rm *
root@yangguang-virtual-machine:/etc/apt/sources.list.d# apt update
命中:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
命中:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
命中:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
命中:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
命中:5 http://archive.ubuntu.com/ubuntu xenial InRelease
命中:6 http://archive.canonical.com/ubuntu xenial InRelease
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
有 5 个软件包可以升级。请执行 ‘apt list --upgradable’ 来查看它们。
root@yangguang-virtual-machine:/etc/apt/sources.list.d# apt install software-properties-common
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
software-properties-common 已经是最新版 (0.96.24.32.7)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
root@yangguang-virtual-machine:/etc/apt/sources.list.d# apt install python3.7
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
注意,根据正则表达式 'python3.7' 选中了 'python3.7-gdbm'
注意,选中 'python3-gdbm' 而非 'python3.7-gdbm'
python3-gdbm 已经是最新版 (3.6.7-1~18.04)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
root@yangguang-virtual-machine:/etc/apt/sources.list.d# apt install python3.8
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
python3.8 已经是最新版 (3.8.3-1+bionic1)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 5 个软件包未被升级。
root@yangguang-virtual-machine:/etc/apt/sources.list.d# python3.8 --version
Python 3.8.3
root@yangguang-virtual-machine:/etc/apt/sources.list.d# whereis python
python: /usr/bin/python2.7 /usr/bin/python3.6 /usr/bin/python3.8 /usr/bin/python3.6m /usr/bin/python /usr/lib/python2.7 /usr/lib/python3.6 /usr/lib/python3.7 /usr/lib/python3.8 /etc/python2.7 /etc/python3.6 /etc/python3.8 /etc/python /usr/local/lib/python2.7 /usr/local/lib/python3.6 /usr/local/lib/python3.8 /usr/include/python3.6m /usr/share/python /usr/share/man/man1/python.1.gz
root@yangguang-virtual-machine:/etc/apt/sources.list.d# python
Python 2.7.17 (default, Apr 15 2020, 17:20:14)
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@yangguang-virtual-machine:/etc/apt/sources.list.d# python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@yangguang-virtual-machine:/etc/apt/sources.list.d# python3.8
Python 3.8.3 (default, May 14 2020, 20:11:43)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
root@yangguang-virtual-machine:/etc/apt/sources.list.d#
上面的内容均是对按照以下安装方式导致出错的解决办法和过程。
使用Apt在Ubuntu 18.04上安装Python 3.8 使用apt在Ubuntu 18.04上安装Python 3.8是一个相对简单的过程,只需几分钟: 1、以root用户或具有sudo访问权限的用户身份运行以下命令,以更新软件包列表并安装必备组件: $ sudo apt update $ sudo apt install software-properties-common 2、将Deadsnakes PPA添加到系统的来源列表中: $ sudo add-apt-repository ppa:deadsnakes/ppa 参考:Ubuntu 18.04/16.04/Debian 9上安装add-apt-repository的方法。 出现提示时,按Enter继续: Press [ENTER] to continue or Ctrl-c to cancel adding it. 注:意思是按[ENTER]继续,或按Ctrl-c取消添加。 3、启用存储库后,请使用以下命令安装Python 3.8: $ sudo apt install python3.8 4、通过键入以下命令验证安装是否成功: $ python3.8 --version 返回信息: Python 3.8.0 至此,Python 3.8已安装在Ubuntu 18.04系统上,你可以开始使用它了。
从源代码在Ubuntu 18.04上安装Python 3.8 在本节中,我们将说明如何从源代码编译Python 3.8。 1、更新软件包列表并安装构建Python所需的软件包: $ sudo apt update $ sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget 2、使用wget从Python下载页面下载最新版本的源代码,或者访问 https://www.python.org/ 网站下载: $ wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz 在选写本文时,最新版本是3.8.0。 3、下载完成后,解压缩下载的文件: $ tar -xf Python-3.8.0.tgz 4、切换到Python源目录并执行configure脚本,该脚本执行许多检查以确保系统上的所有依赖项都存在: $ cd Python-3.8.0 $ ./configure --enable-optimizations --enable-optimizations选项通过运行多个测试来优化Python二进制文件,这会使构建过程变慢。 5、启动Python 3.8构建过程: $ make -j 8 为了加快构建时间,请修改-j以使其对应于处理器中的内核数,你可以通过键入nproc查找编号。 6、构建过程完成后,输入以下命令安装Python二进制文件: $ sudo make altinstall 不要使用标准的make install,因为它将覆盖默认的系统python3二进制文件。 7、Python 3.8已安装并准备使用,通过运行以下命令进行验证: $ python3.8 --version 输出应显示Python版本: Python 3.8.0 至此,你已在Ubuntu 18.04计算机上安装了Python 3.8,然后可以开始开发Python 3项目了。 |