Ubuntu在 16.04中放弃了 Python 2 。不过,它在升级后仍会安装(它不是“过时软件包”的一部分)。
有没有一种干净的方法可以干净地删除 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.
由于仍然有很多依赖于 Python2 的包(如 Samba 和 VirtualBox),因此在继续之前,您应该仔细查看 apt 想要删除的包。
利用
完全删除 Python2 和所有依赖它的东西。