How to remove Python 2 in 16.04?











up vote
8
down vote

favorite
3












Ubuntu has dropped Python 2 in 16.04. It is still installed after an upgrade, though (it was not part of the "obsolete packages").



Is there a clean way to remove Python 2 and all its dependencies in a clean way (to completely get rid of it)?



Is an apt purge the way to go?



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.









share|improve this question




















  • 2




    What exactly do you mean by "clean way"? Python2 is only installed if some of the packages need it. Removing it might break the system.
    – mikewhatever
    Apr 23 '16 at 9:36












  • @mikewhatever: I did an upgrade from 15.10 where Python 2 was needed by the system. Since 16.04 does not ship it at all it means it is not needed anymore. So removing Python 2 should not break the system - which is what I fear the most. As for extra software - it does not matter if they break (I will remove them as well in that case)
    – WoJ
    Apr 23 '16 at 9:39












  • Well, good luck then. :~)
    – mikewhatever
    Apr 23 '16 at 9:46






  • 3




    However, many apps still need it. Maybe the update installed something requiring python2? I'd say don't remove it.
    – UniversallyUniqueID
    Apr 23 '16 at 9:58










  • @BharadwajRaju: wouldn't apt purge show me the dependencies? - and allow me to make up my mind (in my case samba would be a problematic package to remove for instance)
    – WoJ
    Apr 23 '16 at 10:00















up vote
8
down vote

favorite
3












Ubuntu has dropped Python 2 in 16.04. It is still installed after an upgrade, though (it was not part of the "obsolete packages").



Is there a clean way to remove Python 2 and all its dependencies in a clean way (to completely get rid of it)?



Is an apt purge the way to go?



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.









share|improve this question




















  • 2




    What exactly do you mean by "clean way"? Python2 is only installed if some of the packages need it. Removing it might break the system.
    – mikewhatever
    Apr 23 '16 at 9:36












  • @mikewhatever: I did an upgrade from 15.10 where Python 2 was needed by the system. Since 16.04 does not ship it at all it means it is not needed anymore. So removing Python 2 should not break the system - which is what I fear the most. As for extra software - it does not matter if they break (I will remove them as well in that case)
    – WoJ
    Apr 23 '16 at 9:39












  • Well, good luck then. :~)
    – mikewhatever
    Apr 23 '16 at 9:46






  • 3




    However, many apps still need it. Maybe the update installed something requiring python2? I'd say don't remove it.
    – UniversallyUniqueID
    Apr 23 '16 at 9:58










  • @BharadwajRaju: wouldn't apt purge show me the dependencies? - and allow me to make up my mind (in my case samba would be a problematic package to remove for instance)
    – WoJ
    Apr 23 '16 at 10:00













up vote
8
down vote

favorite
3









up vote
8
down vote

favorite
3






3





Ubuntu has dropped Python 2 in 16.04. It is still installed after an upgrade, though (it was not part of the "obsolete packages").



Is there a clean way to remove Python 2 and all its dependencies in a clean way (to completely get rid of it)?



Is an apt purge the way to go?



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.









share|improve this question















Ubuntu has dropped Python 2 in 16.04. It is still installed after an upgrade, though (it was not part of the "obsolete packages").



Is there a clean way to remove Python 2 and all its dependencies in a clean way (to completely get rid of it)?



Is an apt purge the way to go?



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.






package-management python uninstall 16.04






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 23 '16 at 9:43

























asked Apr 23 '16 at 9:34









WoJ

4732924




4732924








  • 2




    What exactly do you mean by "clean way"? Python2 is only installed if some of the packages need it. Removing it might break the system.
    – mikewhatever
    Apr 23 '16 at 9:36












  • @mikewhatever: I did an upgrade from 15.10 where Python 2 was needed by the system. Since 16.04 does not ship it at all it means it is not needed anymore. So removing Python 2 should not break the system - which is what I fear the most. As for extra software - it does not matter if they break (I will remove them as well in that case)
    – WoJ
    Apr 23 '16 at 9:39












  • Well, good luck then. :~)
    – mikewhatever
    Apr 23 '16 at 9:46






  • 3




    However, many apps still need it. Maybe the update installed something requiring python2? I'd say don't remove it.
    – UniversallyUniqueID
    Apr 23 '16 at 9:58










  • @BharadwajRaju: wouldn't apt purge show me the dependencies? - and allow me to make up my mind (in my case samba would be a problematic package to remove for instance)
    – WoJ
    Apr 23 '16 at 10:00














  • 2




    What exactly do you mean by "clean way"? Python2 is only installed if some of the packages need it. Removing it might break the system.
    – mikewhatever
    Apr 23 '16 at 9:36












  • @mikewhatever: I did an upgrade from 15.10 where Python 2 was needed by the system. Since 16.04 does not ship it at all it means it is not needed anymore. So removing Python 2 should not break the system - which is what I fear the most. As for extra software - it does not matter if they break (I will remove them as well in that case)
    – WoJ
    Apr 23 '16 at 9:39












  • Well, good luck then. :~)
    – mikewhatever
    Apr 23 '16 at 9:46






  • 3




    However, many apps still need it. Maybe the update installed something requiring python2? I'd say don't remove it.
    – UniversallyUniqueID
    Apr 23 '16 at 9:58










  • @BharadwajRaju: wouldn't apt purge show me the dependencies? - and allow me to make up my mind (in my case samba would be a problematic package to remove for instance)
    – WoJ
    Apr 23 '16 at 10:00








2




2




What exactly do you mean by "clean way"? Python2 is only installed if some of the packages need it. Removing it might break the system.
– mikewhatever
Apr 23 '16 at 9:36






What exactly do you mean by "clean way"? Python2 is only installed if some of the packages need it. Removing it might break the system.
– mikewhatever
Apr 23 '16 at 9:36














@mikewhatever: I did an upgrade from 15.10 where Python 2 was needed by the system. Since 16.04 does not ship it at all it means it is not needed anymore. So removing Python 2 should not break the system - which is what I fear the most. As for extra software - it does not matter if they break (I will remove them as well in that case)
– WoJ
Apr 23 '16 at 9:39






@mikewhatever: I did an upgrade from 15.10 where Python 2 was needed by the system. Since 16.04 does not ship it at all it means it is not needed anymore. So removing Python 2 should not break the system - which is what I fear the most. As for extra software - it does not matter if they break (I will remove them as well in that case)
– WoJ
Apr 23 '16 at 9:39














Well, good luck then. :~)
– mikewhatever
Apr 23 '16 at 9:46




Well, good luck then. :~)
– mikewhatever
Apr 23 '16 at 9:46




3




3




However, many apps still need it. Maybe the update installed something requiring python2? I'd say don't remove it.
– UniversallyUniqueID
Apr 23 '16 at 9:58




However, many apps still need it. Maybe the update installed something requiring python2? I'd say don't remove it.
– UniversallyUniqueID
Apr 23 '16 at 9:58












@BharadwajRaju: wouldn't apt purge show me the dependencies? - and allow me to make up my mind (in my case samba would be a problematic package to remove for instance)
– WoJ
Apr 23 '16 at 10:00




@BharadwajRaju: wouldn't apt purge show me the dependencies? - and allow me to make up my mind (in my case samba would be a problematic package to remove for instance)
– WoJ
Apr 23 '16 at 10:00










1 Answer
1






active

oldest

votes

















up vote
15
down vote



accepted










As there are still a lot of packages that depend on Python2 (like Samba and VirtualBox) you should have a close look at the packages that apt wants to remove before you let it proceed.



Use



sudo apt purge python2.7-minimal


to completely remove Python2 and everything that depends on it.






share|improve this answer























  • I just did it, and many things got uninstalled. So far the only I'm missing is "duplicity", so my deja-dup backup copies are now broken because deja-dup relies on duplicity. It seems there's still not a duplicity version that supports python 3, and they keep doing changes with python 2.7, so it's unlikely it's going to be one anywhere in the near future. It's somehow a shame because deja-dup is the default backup system in Ubuntu.
    – Fran Marzoa
    May 13 '17 at 14:35












  • JFTR, the pulseaudio-equalizer also seem to depend on Python2 still...
    – Fran Marzoa
    May 14 '17 at 10:09










  • Calibre ebook application also depends on python 2.7
    – Fran Marzoa
    May 16 '17 at 7:42










  • The Gimp also depends on python 2.7
    – Fran Marzoa
    May 21 '17 at 21:30






  • 2




    I read the comment too late....
    – fabio.sang
    Apr 25 at 20:35











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f761106%2fhow-to-remove-python-2-in-16-04%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
15
down vote



accepted










As there are still a lot of packages that depend on Python2 (like Samba and VirtualBox) you should have a close look at the packages that apt wants to remove before you let it proceed.



Use



sudo apt purge python2.7-minimal


to completely remove Python2 and everything that depends on it.






share|improve this answer























  • I just did it, and many things got uninstalled. So far the only I'm missing is "duplicity", so my deja-dup backup copies are now broken because deja-dup relies on duplicity. It seems there's still not a duplicity version that supports python 3, and they keep doing changes with python 2.7, so it's unlikely it's going to be one anywhere in the near future. It's somehow a shame because deja-dup is the default backup system in Ubuntu.
    – Fran Marzoa
    May 13 '17 at 14:35












  • JFTR, the pulseaudio-equalizer also seem to depend on Python2 still...
    – Fran Marzoa
    May 14 '17 at 10:09










  • Calibre ebook application also depends on python 2.7
    – Fran Marzoa
    May 16 '17 at 7:42










  • The Gimp also depends on python 2.7
    – Fran Marzoa
    May 21 '17 at 21:30






  • 2




    I read the comment too late....
    – fabio.sang
    Apr 25 at 20:35















up vote
15
down vote



accepted










As there are still a lot of packages that depend on Python2 (like Samba and VirtualBox) you should have a close look at the packages that apt wants to remove before you let it proceed.



Use



sudo apt purge python2.7-minimal


to completely remove Python2 and everything that depends on it.






share|improve this answer























  • I just did it, and many things got uninstalled. So far the only I'm missing is "duplicity", so my deja-dup backup copies are now broken because deja-dup relies on duplicity. It seems there's still not a duplicity version that supports python 3, and they keep doing changes with python 2.7, so it's unlikely it's going to be one anywhere in the near future. It's somehow a shame because deja-dup is the default backup system in Ubuntu.
    – Fran Marzoa
    May 13 '17 at 14:35












  • JFTR, the pulseaudio-equalizer also seem to depend on Python2 still...
    – Fran Marzoa
    May 14 '17 at 10:09










  • Calibre ebook application also depends on python 2.7
    – Fran Marzoa
    May 16 '17 at 7:42










  • The Gimp also depends on python 2.7
    – Fran Marzoa
    May 21 '17 at 21:30






  • 2




    I read the comment too late....
    – fabio.sang
    Apr 25 at 20:35













up vote
15
down vote



accepted







up vote
15
down vote



accepted






As there are still a lot of packages that depend on Python2 (like Samba and VirtualBox) you should have a close look at the packages that apt wants to remove before you let it proceed.



Use



sudo apt purge python2.7-minimal


to completely remove Python2 and everything that depends on it.






share|improve this answer














As there are still a lot of packages that depend on Python2 (like Samba and VirtualBox) you should have a close look at the packages that apt wants to remove before you let it proceed.



Use



sudo apt purge python2.7-minimal


to completely remove Python2 and everything that depends on it.







share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 23 at 16:51









Community

1




1










answered Apr 23 '16 at 10:16









Florian Diesch

64k16160177




64k16160177












  • I just did it, and many things got uninstalled. So far the only I'm missing is "duplicity", so my deja-dup backup copies are now broken because deja-dup relies on duplicity. It seems there's still not a duplicity version that supports python 3, and they keep doing changes with python 2.7, so it's unlikely it's going to be one anywhere in the near future. It's somehow a shame because deja-dup is the default backup system in Ubuntu.
    – Fran Marzoa
    May 13 '17 at 14:35












  • JFTR, the pulseaudio-equalizer also seem to depend on Python2 still...
    – Fran Marzoa
    May 14 '17 at 10:09










  • Calibre ebook application also depends on python 2.7
    – Fran Marzoa
    May 16 '17 at 7:42










  • The Gimp also depends on python 2.7
    – Fran Marzoa
    May 21 '17 at 21:30






  • 2




    I read the comment too late....
    – fabio.sang
    Apr 25 at 20:35


















  • I just did it, and many things got uninstalled. So far the only I'm missing is "duplicity", so my deja-dup backup copies are now broken because deja-dup relies on duplicity. It seems there's still not a duplicity version that supports python 3, and they keep doing changes with python 2.7, so it's unlikely it's going to be one anywhere in the near future. It's somehow a shame because deja-dup is the default backup system in Ubuntu.
    – Fran Marzoa
    May 13 '17 at 14:35












  • JFTR, the pulseaudio-equalizer also seem to depend on Python2 still...
    – Fran Marzoa
    May 14 '17 at 10:09










  • Calibre ebook application also depends on python 2.7
    – Fran Marzoa
    May 16 '17 at 7:42










  • The Gimp also depends on python 2.7
    – Fran Marzoa
    May 21 '17 at 21:30






  • 2




    I read the comment too late....
    – fabio.sang
    Apr 25 at 20:35
















I just did it, and many things got uninstalled. So far the only I'm missing is "duplicity", so my deja-dup backup copies are now broken because deja-dup relies on duplicity. It seems there's still not a duplicity version that supports python 3, and they keep doing changes with python 2.7, so it's unlikely it's going to be one anywhere in the near future. It's somehow a shame because deja-dup is the default backup system in Ubuntu.
– Fran Marzoa
May 13 '17 at 14:35






I just did it, and many things got uninstalled. So far the only I'm missing is "duplicity", so my deja-dup backup copies are now broken because deja-dup relies on duplicity. It seems there's still not a duplicity version that supports python 3, and they keep doing changes with python 2.7, so it's unlikely it's going to be one anywhere in the near future. It's somehow a shame because deja-dup is the default backup system in Ubuntu.
– Fran Marzoa
May 13 '17 at 14:35














JFTR, the pulseaudio-equalizer also seem to depend on Python2 still...
– Fran Marzoa
May 14 '17 at 10:09




JFTR, the pulseaudio-equalizer also seem to depend on Python2 still...
– Fran Marzoa
May 14 '17 at 10:09












Calibre ebook application also depends on python 2.7
– Fran Marzoa
May 16 '17 at 7:42




Calibre ebook application also depends on python 2.7
– Fran Marzoa
May 16 '17 at 7:42












The Gimp also depends on python 2.7
– Fran Marzoa
May 21 '17 at 21:30




The Gimp also depends on python 2.7
– Fran Marzoa
May 21 '17 at 21:30




2




2




I read the comment too late....
– fabio.sang
Apr 25 at 20:35




I read the comment too late....
– fabio.sang
Apr 25 at 20:35


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f761106%2fhow-to-remove-python-2-in-16-04%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents