ubuntu20.04打不开终端

安装python3.6后,打不开终端

ubuntu20.04自带python3.8,重新安装了python导致终端打不开
解决方法:
1.Alt+Ctrl+F6,打开命令行界面(Alt+Ctrl+F1可回到图形界面)
2.安装一个辅助终端Xterm
sudo apt install xterm
3.使用命令行gnome-terminal,终端无法打开
4.查看现有的python版本
ls /usr/bin/python*
4.恢复软连接(python3.8)
sudo ln -s /usr/bin/python3.8 /usr/bin/python3
5.输入gnome-terminal,终端可打开了

(1)若问题没有解决(python3.8被损坏),可使用命令行恢复python3.8的安装
sudo apt-get install --reinstall python3.8-minimal
备注
删除软连接命令行
sudo rm -rf /usr/bin/python3

附python安装教程

1.安装依赖
sudo apt-get install -y gcc make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev
2.下载源代码
wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz
3.解压
tar -xzf Python-3.6.8.tgz
4.配置
cd Python-3.6.8
sudo ./configure --enable-optimizations --prefix=/usr/local/bin/python3.6
5.编译&安装
sudo make
sudo make install
6.设置软连接
sudo ln -s -f /usr/local/bin/python3.6/bin/python3.6 /usr/bin/python3.6
sudo ln -s -f /usr/local/bin/python3.6/bin/pip3.6 /usr/bin/pip3.6

注:
ubuntu内置python,若设置软连接后导致python版本冲突则需要上面的方式解决

你可能感兴趣的:(ubuntu20.04打不开终端)