如何从 Ubuntu 18.04 中完全删除 Python 3.6
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50298011/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to remove Python 3.6 completely from Ubuntu 18.04
提问by Sandip Nath
Both Python 2.7 and 3.6 are installed by default in Ubuntu 18. But I wish to use the Anaconda Python with conda package manager. To avoid any conflicts I wish to completely remove the default Python 3.6. Are there any way to do that? Please help.
默认情况下,Ubuntu 18 中安装了 Python 2.7 和 3.6。但我希望将 Anaconda Python 与 conda 包管理器一起使用。为了避免任何冲突,我希望完全删除默认的 Python 3.6。有没有办法做到这一点?请帮忙。
采纳答案by Prometheus
Ubuntu 18.04 requires python 3.6 to function. If you remove python 3.6, you won't be able to log in after a restart. Ubuntu will still have python 3.6minimal, even after uninstalling python 3.6. so you will have to remove both. Once that is done, you'll get an error that looks like this.
Ubuntu 18.04 需要 python 3.6 才能运行。如果删除python 3.6,重启后将无法登录。即使在卸载 python 3.6 之后,Ubuntu 仍然会有 python 3.6minimal。所以你将不得不删除两者。完成后,您将收到如下所示的错误。
https://itsfoss.com/failed-to-start-session-ubuntu-14-04/
https://itsfoss.com/failed-to-start-session-ubuntu-14-04/
You can follow the above steps if you break Ubuntu.
如果你破坏了 Ubuntu,你可以按照上面的步骤操作。
回答by Jo?o Melo
Don't do that , just don't.
you'll have regrets a lot of it.
And I'm serious.
A lot of things will deleted,but by the way, if you already done that don't worry, there is a solutions.
Just run this code in your terminal
不要那样做,不要那样做。
你会后悔很多。
而且我是认真的。
很多东西会被删除,但顺便说一下,如果你已经这样做了,别担心,有一个解决方案。
只需在终端中运行此代码
sudo apt install ubuntu-desktop
And if you want you can run this one too
如果你愿意,你也可以运行这个
#ubuntu-18.04.1
sudo apt install $( curl http://releases.ubuntu.com/18.04/ubuntu-18.04.1-desktop-amd64.manifest | sed -e 's#\t.*##g' )
Link for reference: https://askubuntu.com/questions/1087267/how-do-i-reinstall-the-software-packages-that-came-with-ubuntu-18-04
参考链接:https: //askubuntu.com/questions/1087267/how-do-i-reinstall-the-software-packages-that-came-with-ubuntu-18-04