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 许可协议。转载请注明出处!
相关文章
Nginx配置http跳转https-强制https访问
前言 最近上线了好几个项目,同时也申请了相应的SSL证书,不过发现了一个问题,用户在浏览器直接输入域名的时候,浏览器默认访问的是http站点,然而我们的网站只支持https访问,所以就访问不了咯。 其实可以在nginx全局配置里面把所有访问重定向到https,不过服务器有些站点是提供http服务的,所以只能每个站点分别配置。 根据搜索引擎找到的资料,本文总结了三种配置方法,有需要的朋友可以选择中意
2025-10-27 · 系统配置 · 约 1 分钟
修改Linux系统的鼠标滚轮的速度
Linux默认的鼠标滚轮实在太慢了,总是让我有一种Linux很卡的错觉,而且还不像Windows那样可以直接修改所有程序中的鼠标滚轮速度,不过没事,可以用imwheel这个工具来修改~ 安装 Debian系: sudo apt install imwheel Arch: sudo pacman -S imwheel 配置 创建~/.imwheelrc文件 nano ~/.imwheelrc 编辑内
2025-10-27 · 系统配置 · 约 1 分钟
Debian下SSH服务的安装与配置
https://cnzhx.net/blog/linux-server-ssh-key-auth-configuration/
2025-10-27 · 系统配置 · 约 1 分钟
服务器时间漂移,如何开启Linux NTP自动同步
本文记录了作者在服务器运维中发现时间漂移问题,并通过启用NTP同步、使用Chrony等工具进行排查与解决的全过程。文章强调了NTP同步的重要性,介绍了排查思路和高效工具的使用,以及如何同步硬件时钟(RTC),为服务器时间精准同步提供了解决方案。
2025-10-27 · 系统配置 · 约 1 分钟
讨论
共 0 条加载评论中…