Ubuntu 有删除了 Python 2在 16.04 中。不过,升级后它仍然被安装(它不是“过时软件包”的一部分)。
有没有干净的方法来删除 Python 2及其所有依赖项以一种干净的方式(彻底摆脱它)?
是apt purge
可行的方法吗?
root@ubuntu ~# apt purge python2.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libnss-ldap
Use 'apt autoremove' to remove it.
The following packages will be REMOVED:
auth-client-config* ldap-auth-client* ldap-auth-config* libpam-ldap* libsmbclient* ndiff* python* python-bs4* python-chardet* python-crypto* python-dnspython*
python-html5lib* python-ldb* python-lxml* python-ntdb* python-pkg-resources* python-samba* python-setuptools* python-six* python-talloc* python-tdb* python2.7* samba*
samba-common-bin* samba-dsdb-modules* samba-libs* samba-vfs-modules* smbclient* winbind*
0 upgraded, 0 newly installed, 29 to remove and 0 not upgraded.
After this operation, 58.4 MB disk space will be freed.
答案1
由于仍有许多依赖于 Python2 的软件包(例如 Samba 和 VirtualBox),因此在让 apt 继续运行之前,您应该仔细查看它想要删除的软件包。
使用
sudo apt purge python2.7-minimal
完全删除 Python2 以及所有依赖它的程序。