返回文章列表文章索引阅读全文
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 许可协议。转载请注明出处!

相关文章

Linux设置系统邮件转发到指定邮箱

前言 在Linux的操作中,有的时候每敲一下回车,就出来You have new mail in /var/spool/mail/root的提示,究竟是为什么呢? Linux 系统经常会自动发出一些邮件来提醒用户系统中出了哪些问题(收件箱位置:/var/mail/)。可是这些邮件都是发送给 root 用户的。出于系统安全考虑,通常不建议大家直接使用 root 帐户进行日常操作。所以要想点办法来让系

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

讨论

共 0 条

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

加载评论中…