曦远 (DealiAxy)一份私人的文字刊物

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 许可协议。转载请注明出处!

相关文章

Debian配置默认不开启图形界面

前言 Linux的图形界面实在是太耗资源了,同时开几个虚拟机感觉已经hold不住了,赶紧把这些Linux服务器的图形界面都关掉。 CLI:command Line Interface,命令行界面。 现在的Linux发行版默认登陆界面几乎都是默认为GUI界面,如果按照旧版本的修改inittab文件,在一些比较新的版本是没有这个文件的(Linux的启动服务机制发生改变) 修改Grub配置文件 打开gr

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

关闭CentOS-6-防火墙,关闭Linux系统防火墙

前言 最近部署服务的时候需要临时关闭一下防火墙,所以记个笔记,如何关闭CentOS防火墙。 查看系统版本 输入:cat /etc/issue 查看版本 通过service关闭 service命令开启以及关闭防火墙为即时生效,下次重启机器的时候会自动复原。 查看防火墙状态: service iptables status 记得在CentOS6.9中是输入iptables,网上有些教程使用serv

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

讨论

共 0 条

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

加载评论中…