Debian8-stable - Upgrade Python version to 3.6
Foreword I recently deployed a Python project to a server, but the Python version on the server was far too outdated, so I set about updating it. The methods I found online all involved downloading the Python 3.6 source code and manually compiling it. However, I encountered some issues while compiling and installing on the server, which led me to consider using Ubuntu’s PPA method. Since Debian and Ubuntu share common origins, Ubuntu’s PPA should theoretically work on Debian as well. The steps are as follows: Add the software source add-apt-reposito
目录7 个章节
Preface
Recently, I deployed a Python project to a server, but the Python version on the server was quite outdated, so I proceeded to update it.
The methods I found online all involved downloading the Python 3.6 source code and compiling it manually. However, I encountered some issues while compiling and installing it on the server. That's when I thought of using Ubuntu's PPA method. Since Debian and Ubuntu share the same origins, in theory, Ubuntu's PPAs should also work on Debian.
The operation steps are as follows:
Adding Software Repository
add-apt-repository ppa:deadsnakes/ppa
However, Debian does not have add-apt-repository, so you need to install it first.
apt-get install software-properties-common
After installing this, you can use the command above to add the PPA source.
Don't rush at this point, because PPAs are originally for Ubuntu, and using them on Debian always requires a few small modifications.
Open the PPA website: https://launchpad.net/~jonathonf/+archive/ubuntu/python-3.6
Select the Ubuntu version 14.04.

Copy these two lines of code.
Then open the directory for software sources:
cd /etc/apt/sources.list.d
You can see there is a file inside:
-rw-r--r-- 1 root root 290 Jun 19 00:26 jonathonf-python-3_6-jessie.list
Edit it:
deb http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu jessie main
deb-src http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu jessie main
Replace the original content with the content just copied, then save.
Update Software Sources & Installation
apt update
apt install python3.6
Install the corresponding version of pip
su
curl https://bootstrap.pypa.io/get-pip.py | python3.6
(pip -V && pip3 -V && pip3.6 -V) | uniq
Check Version
python3.6 -m pip -V
Creating a Symbolic Link
cd /usr/bin
rm python3
ln -s python3.6 python3
And that's it!
_EOF_
Debian8-stable - Upgrade Python version to 3.6
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
Ubuntu-18-04-开启托盘图标点击最小化
前言 Ubuntu的托盘挺好看的,美中不足的就是点击一个打开的应用图标不能像Windows那样最小化。 操作 gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize' 截图
2025-10-27 · 系统配置 · 约 1 分钟
Ubuntu-18-04-修改登录界面背景图
前言 Ubuntu 18.04用了一段时间了,在Gnome桌面的加持下,兔子 18.04 的颜值还不错,加上自己搭配了几套GTK主题,简直美滋滋,唯一美中不足的就是,Ubuntu的登录管理器换成GDM之后,登录界面背景没办法修改了,这怎么行呢,于是经过一番折腾,有了本文。 首先,准备一张图片 图片的尺寸呢,根据你的屏幕分辨率确定咯。 然后把图片放到/usr/share/backgrounds/目录
2025-10-27 · 系统配置 · 约 1 分钟
别再手动复制SSH公钥了,Linux服务器一键从GitHub快速导入公钥
输入GitHub用户名就自动导入SSH公钥?Ubuntu这懒人功能挺省事。原理不就是爬取`https://github.com/用户名.keys`吗?手动用`curl`也能实现,装`ssh-import-id`更高效,但谁稀罕这些花里胡哨的。
2026-03-11 · 系统配置 · 约 1 分钟
Debian下SSH服务的安装与配置
https://cnzhx.net/blog/linux-server-ssh-key-auth-configuration/
2025-10-27 · 系统配置 · 约 1 分钟
讨论
共 0 条加载评论中…