earlier my default python version is python2.7 to upgrade it I deleted python form /usr/bin/ and rename python3.6 as python in the same directory. afterward, my terminal is not working. its gets no response on opening it. please help!!
The main lesson here is not to mess with system files unless you know exactly what you're doing. The directory /usr/bin is managed by the package manager, APT (as in
apt), so you will never need to manually make changes to it. You're not alone though. Lots of folks make changes to the system Python setup without realizing that most of the GUI depends on it.
Now, how can you fix this?
- Access a TTY. See What is a tty, and how do I access a tty?
- If that doesn't work, boot into recovery mode. See How do I boot into recovery mode?
python3.6back, cause the system depends on it (via
/usr/bin/python3, which is a symlink to
sudo mv /usr/bin/python /usr/bin/python3.6
sudo apt-get install --reinstall python2.7-minimal
or remove it
sudo apt-get remove python2.7
- Either figure out another way to set Python 3 as the default (see How to make 'python' program command execute Python 3?), or learn to live with typing