Newbie to linux, I thought that apt-get purge is usually used to remove a pkg totally, but today it neally crash my whold system. I want to remove a previously installed python 3.4 distribution, but I'm not sure which pkg it belongs, so I used find /usr -type f -name "python3.4" to find it, the command returns several lines, the first one is /usr/bin/python3.4, so then I typed dpkg -S /usr/bin/python3.4 to determine which pkg python3.4 belongs, it returns python-minimal, so I typed sudo apt-get purge python-minimal, but then a lot of pkgs was removed, also some installed, I'm totally confused, and I saw even the app store disappeared, a lot of the system was removed... Can someone help me?
When you run apt purge <package> or apt remove <package> you are not only instructing apt to remove the named package, but any other package that depends on it. Of course apt doesn't perform that unexpected operation without first asking for your consent, so I imagine it showed the list of packages that it was going to remove, and when you pressed Y it removed all of them.
So, to undo the mess, if you still have the window where you run the purge then check which packages it told you it was going to remove, and manually apt install them. If you don't have the list around, then you need to manually install every package that is not working properly.
If it is the window manager that got damaged, try apt-get install ubuntu-gnome-desktop or the appropriate package for your distribution/window manager.
Rule of thumb when deleting/updating packages: always read the list of packages affected, sometimes there is unexpected stuff.
What did apt-get purge do?