Linux(Ubuntu)环境下安装卸载Python3(避免踩坑)
warning:
这篇文章距离上次修改已过183天,其中的内容可能已经有所变动。
在Ubuntu环境下安装和卸载Python3,可以使用以下命令:
安装Python3:
sudo apt update
sudo apt install python3
卸载Python3:
sudo apt remove python3
sudo apt autoremove
注意:
- 卸载系统自带的Python可能会导致系统工具出现问题,不建议这样做。
- 如果你是通过编译源码安装的Python3,那么卸载的时候需要进入到源码安装目录,执行
sudo make uninstall
。 - 对于使用
apt
安装的Python3,apt
会跟踪安装的依赖包,如果你确定要彻底卸载,可以使用sudo apt purge
代替sudo apt remove
,这样会删除配置文件。
评论已关闭