web-dev-qa-db-fra.com

Comment supprimer Python 2 en 16.04?

Ubuntu a supprimé Python 2 dans 16.04. Il est toujours installé après une mise à niveau (il ne faisait pas partie des "paquets obsolètes").

Existe-t-il un moyen propre de supprimer Python 2 et toutes ses dépendances de manière propre (de s'en débarrasser complètement)?

Est-ce qu'un apt purge est la solution?

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.
14
WoJ

Comme il y a encore beaucoup de paquets qui dépendent de Python2 (comme Samba et VirtualBox), vous devriez regarder de près les paquets que apt veut supprimer avant de le laisser continuer.

Utilisation

Sudo apt purge python2.7-minimal

supprimer complètement Python2 et tout ce qui en dépend.

22
Florian Diesch