-4

I come from windows 7, and after 8 hours using Ubuntu everything went berserk.

I wanted to uninstall Python3 so I used sudo apt-get purge python3 and that opened the gates of hell.

It removed almost everything on my hard drive, now I have a Ubuntu desktop without even a terminal or the unity launcher, and I can't boot from the USB flash drive that I used to install Ubuntu. Currently in the process of formatting my computer and reinstalling Windows 7 as I lost almost all faith in Ubuntu and Linux in general. If something as trivial as removing a program runs the risk of destroying the operating system along with most of what's installed on my drive then I don't have no business using the OS.

The command I entered: sudo apt-get purge python3

Ubuntu version: 16.04 LTS

PS: this wasn't the main Python version that came with Ubuntu, but one that I installed and then decided to replace with 3.6.3

Can anyone explain why that happened?

Edit: I have used both mint and Manjaro since I posted this thread, and I'm a Linux guy now.. I have a Windows 7/ Manjaro dual boot setting and most (like 85%) of my time using a computer is on Linux. It turns out Ubuntu isn't for me, but happily there are dozens of other options to choose from.

marked as duplicate by karel, Videonauth, Eric Carvalho, Eliah Kagan, pomsky Dec 13 '17 at 16:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Lots of thing in Ubuntu depend on Python. Removing Python broke them. Wasn't a good idea, be careful next time. – mikewhatever Dec 7 '17 at 18:43
  • This wasn't the main Python installation that came with Ubuntu, but another version that I installed then decided to replace with Python 3.6.3 – scripter Dec 7 '17 at 18:44
  • 1
    first, which version of Ubuntu you are talking about, if its one of the recent ones you do not want to remove python3 which is in 17.10 even the sole installed version of python. – Videonauth Dec 7 '17 at 18:45
  • 2
    There is only one python3 version that can be installed at any one time, via the packaging system. How did you install the new version? Why did you try to install it? Why did you not read the output from apt-get which told you exactly what was being removed and think about it before continuing? – dobey Dec 7 '17 at 18:49
  • 1
    16.04 partly depends heavily on both python versions (2.7 and 3.x) you can install other versions of python but you should refrain from removal tries, simply live with the little space wasted. However different python versions can live side by side on Linux if set up right. So all I can say is this... – Videonauth Dec 7 '17 at 19:08
4

You removed support for a language that a lot of system functions and tools are written in. They depend on python3, so apt-get removed them as well. What you have is a slightly less functional system, with important system functions not working.

You can, of course, reinstall python3 (and all the other packages you removed), but I would not be surprised if this is a lot more fiddling than simply reinstalling the system, especially if it's a fresh install.

Linux (including Ubuntu) let's you do stupid things by design. This allows you to make carefully crafted light systems for specific tasks - by sacrificing functionality.

In short, apt(-get) printed all the changes - including the removal of your desktop environment. If you want to mess with important packages, it's a good idea to read trough the package list - if over 15-20 packages is listed it's almost always a sign that you probably do not want to perform that action.

You can try to run sudo apt-get install xubuntu-desktop. xubuntu-desktop is a metapackage, so it will install all the standard packages required for xubuntu desktop system.

If something as trivial as removing a program runs the risk of destroying the operating system along with most of what's installed on my drive then I don't have no business using the OS.

If you perform random actions as superuser, without reading the output, I'd say no OS is safe. Try going to a windows machine, and delete for instance random files in %windir%\System32. And for the future - read the output of apt. And practice using --dry-run

  • Is Firefox such a dependency too? – scripter Dec 7 '17 at 18:56
  • Dependency of what? – vidarlo Dec 7 '17 at 18:57
  • 1
    @scripter: Firefox needs a desktop environment... And the desktop environment needs Pyhton. – AlexP Dec 7 '17 at 18:57
  • I have been using windows since late 1990s and I have committed my fair share of stupid mistakes, but I have never ever had anything even remotely approaching the magnitude of what happened after 8 hours of using Ubuntu, thanks but I'll pass. – scripter Dec 7 '17 at 20:51
  • I might keep experimenting with Ubuntu on my old laptop (mainly when I want to develop something) but after this my main OS will always be Windows. – scripter Dec 7 '17 at 20:52
3

Get into the habit to use apt-get --dry-run; it will save you a lot of grief. Python3 is a dependency of many many packages; look what happens when I simulate its removal on Ubuntu 16.04:

$ sudo apt-get --dry-run purge python3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  fonts-mathjax libexpat1-dev libhunspell-dev libjs-jquery-scrollto
  libjs-mathjax libminizip1 libpython3-dev libpython3.5-dev libqt5clucene5
  libqt5concurrent5 libqt5designer5 libqt5help5 libsnapd-glib1 python-regex
  python3-cssutils sigil-data snapd-login-service
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  gcc-6-base:i386 libboost-log1.58.0 libboost-thread1.58.0 libbz2-1.0:i386
  libc6:i386 libclick-0.4-0 libcontent-hub0 libdb5.3:i386 libexpat1:i386
  libgcc1:i386 libgflags2v5 libgoogle-glog0v5 libgpm2:i386 liblibertine1
  liblttng-ust-ctl2 liblttng-ust0 liblzma5:i386 libmpdec2:i386
  libncursesw5:i386 libpython3-stdlib:i386 libpython3.5-minimal:i386
  libpython3.5-stdlib:i386 libreadline6:i386 libsqlite3-0:i386
  libssl1.0.0:i386 libtinfo5:i386 libubuntu-app-launch2
  libubuntu-download-manager-client1 libubuntu-download-manager-common1
  libudm-common1 liburcu4 python3:i386 python3-minimal:i386 python3.5:i386
  python3.5-minimal:i386 qtdeclarative5-ubuntu-content1 zlib1g:i386
Suggested packages:
  glibc-doc:i386 locales:i386 content-hub gpm:i386 python3-doc:i386
  python3-tk:i386 python3-venv:i386 python3.5-venv:i386 python3.5-doc:i386
  binutils:i386 binfmt-support:i386
The following packages will be REMOVED:
  apport* apport-gtk* aptdaemon* apturl* apturl-common* checkbox-converged*
  checkbox-gui* command-not-found* compiz* compiz-gnome*
  flashplugin-installer* foomatic-db-compressed-ppds* gdebi* gdebi-core*
  gedit* gnome-orca* gnome-software* gnome-terminal* hplip* ibus* ibus-table*
  indicator-bluetooth* language-selector-common* language-selector-gnome*
  nautilus-share* onboard* onboard-data* openprinting-ppds*
  plainbox-provider-checkbox* plainbox-provider-resource-generic*
  printer-driver-foo2zjs* printer-driver-foo2zjs-common*
  printer-driver-postscript-hp* printer-driver-ptouch* printer-driver-pxljr*
  pyotherside* python3* python3-apport* python3-apt* python3-aptdaemon*
  python3-aptdaemon.gtk3widgets* python3-aptdaemon.pkcompat* python3-brlapi*
  python3-cairo* python3-cffi-backend* python3-checkbox-support*
  python3-commandnotfound* python3-cryptography* python3-cssselect*
  python3-cups* python3-dbus* python3-dev* python3-distupgrade* python3-gdbm*
  python3-gi* python3-gi-cairo* python3-jinja2* python3-lxml* python3-mako*
  python3-markupsafe* python3-minimal* python3-oauthlib* python3-pil*
  python3-plainbox* python3-pyatspi* python3-pycurl* python3-pyqt5*
  python3-regex* python3-renderpm* python3-reportlab* python3-reportlab-accel*
  python3-sip* python3-software-properties* python3-systemd* python3-uno*
  python3-update-manager* python3.5* python3.5-dev* python3.5-minimal*
  qml-module-io-thp-pyotherside* rhythmbox* rhythmbox-plugin-zeitgeist*
  rhythmbox-plugins* sessioninstaller* sigil* software-properties-common*
  software-properties-gtk* system-config-printer-common*
  system-config-printer-gnome* system-config-printer-udev* totem-plugins*
  ubuntu-desktop* ubuntu-drivers-common* ubuntu-minimal*
  ubuntu-release-upgrader-core* ubuntu-release-upgrader-gtk* ubuntu-software*
  ubuntu-standard* ubuntu-system-service* unattended-upgrades* unity*
  unity-control-center* unity-control-center-signon* unity-lens-photos*
  unity-scope-calculator* unity-scope-chromiumbookmarks*
  unity-scope-colourlovers* unity-scope-devhelp* unity-scope-firefoxbookmarks*
  unity-scope-gdrive* unity-scope-manpages* unity-scope-openclipart*
  unity-scope-texdoc* unity-scope-tomboy* unity-scope-virtualbox*
  unity-scope-yelp* unity-scope-zotero* unity-tweak-tool*
  unity-webapps-common* update-manager* update-manager-core* update-notifier*
  update-notifier-common* usb-creator-common* usb-creator-gtk* xdiagnose*
The following NEW packages will be installed:
  gcc-6-base:i386 libboost-log1.58.0 libboost-thread1.58.0 libbz2-1.0:i386
  libc6:i386 libclick-0.4-0 libcontent-hub0 libdb5.3:i386 libexpat1:i386
  libgcc1:i386 libgflags2v5 libgoogle-glog0v5 libgpm2:i386 liblibertine1
  liblttng-ust-ctl2 liblttng-ust0 liblzma5:i386 libmpdec2:i386
  libncursesw5:i386 libpython3-stdlib:i386 libpython3.5-minimal:i386
  libpython3.5-stdlib:i386 libreadline6:i386 libsqlite3-0:i386
  libssl1.0.0:i386 libtinfo5:i386 libubuntu-app-launch2
  libubuntu-download-manager-client1 libubuntu-download-manager-common1
  libudm-common1 liburcu4 python3:i386 python3-minimal:i386 python3.5:i386
  python3.5-minimal:i386 qtdeclarative5-ubuntu-content1 zlib1g:i386
0 upgraded, 37 newly installed, 126 to remove and 0 not upgraded.

Not the answer you're looking for? Browse other questions tagged or ask your own question.