返回文章列表文章索引阅读全文
STARBLOG / 阅读手记
系统配置

Ubuntu-16-04-Upgrade Python version to 3-6

Preface I had no choice, the Unity desktop is just too convenient. While I had installed the Unity desktop on Ubuntu 18.04, it still wasn't perfect. So yesterday, I downgraded to Ubuntu 16.04 to enjoy the native Unity desktop experience. Everything was okay, but the Python version was a bit outdated, so I needed to use the versatile PPA repository to upgrade it. Action Install Python 3.6 sudo add-apt-repository ppa:jonathonf/python-3.6 sudo apt-get update sudo apt-get install python3.6

曦远 (DealiAxy)约 6 分钟
目录5 个章节

Preface

There's no way around it—the Unity desktop is just too good. While having Unity installed on Ubuntu 18.04 works, it's not entirely seamless. So yesterday, I decided to downgrade to Ubuntu 16.04 to enjoy the native Unity desktop experience.

Everything is working smoothly, but the default Python version is a bit outdated. Therefore, I need to upgrade it using the trusty PPA repository.

Operations

Installing Python 3.6

sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6

Switching Python Versions: Warning! After a period of testing, it's best not to switch the Python3 version here; just keep version 3.5. Many Ubuntu system software depend on Python, and I've personally experienced that upgrading to 3.6 causes many programs to malfunction!

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 2
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
sudo update-alternatives --config python3

Verification

python3 -V

Result:

OK!

Installing pip3

curl https://bootstrap.pypa.io/get-pip.py | sudo python3.6

Terminal Won't Open Issue

After upgrading to Python 3.6, if the built-in terminal fails to open, you can press Ctrl+Alt+F1 to switch to the command line and execute the following commands:

cd /usr/lib/python3/dist-packages/gi/
sudo cp _gi.cpython-35m-x86_64-linux-gnu.so _gi.cpython-36m-x86_64-linux-gnu.so
sudo cp _gi_cairo.cpython-35m-x86_64-linux-gnu.so _gi_cairo.cpython-36m-x86_64-linux-gnu.so

After that, press Ctrl+Alt+F7 to switch back to the graphical interface, and everything should be back to normal~

About


For more interesting content, follow my WeChat public account (微信公众号): DealiAxy. Every article is also featured on my blog: blog.deali.cn

_EOF_

Ubuntu-16-04-Upgrade Python version to 3-6

本文作者:
程序设计实验室
版权声明:
本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!

相关文章

在Nginx上配置https加密服务器

前言 最近开发微信小程序需要使用Https,于是折腾了一番。 超简单步骤 1. 申请SSL证书 一般云服务器提供商就会提供这种服务,我在腾讯云上申请了,十分钟就完成了。 2. 上传证书 上传到一个文件夹里面 3. 配置nginx 网络上的资料都是直接修改 /etc/nginx/nginx.conf 这个文件。 不过我的服务器上这个文件里头没有 server 这个节点可以配置。 因此需要修改 /et

2025-10-27 · 系统配置 · 约 1 分钟

讨论

共 0 条

良言一句三冬暖,恶语伤人六月寒。

加载评论中…

Ubuntu-16-04-Upgrade Python version to 3-6 · StarBlog