Broke my centos7 VPS when trying to update Python
Broke my centos7 VPS when trying to update Python
I followed this guide in order to update python running on my Centos7 vps. unfortunately this messed some things up. I didn't know that centos7 relied on python 2.7.
Im now unable to perform yum or any other commands. I don't know where to start to fix this problem as I want to revert back to my old Python version of 2.7.5(-58.el7)
when performing yum I get: No module named yum
What is the best way to revert my noob changes:)?
Im now unable to perform yum or any other commands. I don't know where to start to fix this problem as I want to revert back to my old Python version of 2.7.5(-58.el7)
when performing yum I get: No module named yum
What is the best way to revert my noob changes:)?
Re: Broke my centos7 VPS when trying to update Python
Looking through that document it looks like it would install Python 3.6 in parallel to your existing CentOS-provided python, so it should not break yum.
Did you deviate from those instructions somehow?
Did you deviate from those instructions somehow?
Re: Broke my centos7 VPS when trying to update Python
yes, I tried to enable it since the output of python --version was 2.7.5. and I wanted it to have on version 3. Think it was the commands below which messed things up
scl enable python36u bash
sudo ln -fs /usr/bin/python3 /usr/bin/python
I do have a log file of the commands I used in order to update python. But it's a long list. I went pretty nuts on trying to get python 3 running fully unexperienced and unaware that I could break stuff
scl enable python36u bash
sudo ln -fs /usr/bin/python3 /usr/bin/python
I do have a log file of the commands I used in order to update python. But it's a long list. I went pretty nuts on trying to get python 3 running fully unexperienced and unaware that I could break stuff
Re: Broke my centos7 VPS when trying to update Python
That broke it. It should look likesudo ln -fs /usr/bin/python3 /usr/bin/python
lrwxrwxrwx. 1 root root 7 Apr 30 01:25 /usr/bin/python -> python2
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
-
- Posts: 215
- Joined: 2016/03/16 02:34:19
Re: Broke my centos7 VPS when trying to update Python
Assuming none of these commands rely on Python, you should be able to:
Cheer,
Mike
Code: Select all
cd /usr/bin
ln -sf python2 python
Mike
Solution Architect @RedHat | RHCE
Former SysAdmin @BlueSkyStudios and @Pixar
Feature animation and VFX enthusiast
--
Report CentOS Stream 8 bugs: https://da.gd/c8s-bugs
Report CentOS Stream 9 bugs: https://da.gd/c9s-bugs
Former SysAdmin @BlueSkyStudios and @Pixar
Feature animation and VFX enthusiast
--
Report CentOS Stream 8 bugs: https://da.gd/c8s-bugs
Report CentOS Stream 9 bugs: https://da.gd/c9s-bugs
Re: Broke my centos7 VPS when trying to update Python
I got this as output: ln: failed to access ‘python’: Too many levels of symbolic linksMike_Rochefort wrote: ↑2018/08/07 11:47:04Assuming none of these commands rely on Python, you should be able to:
Cheer,Code: Select all
cd /usr/bin ln -sf python2 python
Mike
-
- Posts: 215
- Joined: 2016/03/16 02:34:19
Re: Broke my centos7 VPS when trying to update Python
Are you running as root or using sudo? If yes, try removing the symbolic link completely (rm python) then recreate it with python2.
Cheers,
Mike
Cheers,
Mike
Solution Architect @RedHat | RHCE
Former SysAdmin @BlueSkyStudios and @Pixar
Feature animation and VFX enthusiast
--
Report CentOS Stream 8 bugs: https://da.gd/c8s-bugs
Report CentOS Stream 9 bugs: https://da.gd/c9s-bugs
Former SysAdmin @BlueSkyStudios and @Pixar
Feature animation and VFX enthusiast
--
Report CentOS Stream 8 bugs: https://da.gd/c8s-bugs
Report CentOS Stream 9 bugs: https://da.gd/c9s-bugs
Re: Broke my centos7 VPS when trying to update Python
One would expec to see:
That is,
the /usr/bin/python2.7 is a file.
The /usr/bin/python2 is a symbolic link to /usr/bin/python2.7
The /usr/bin/python is a symbolic link to /usr/bin/python2
What have you now?
Furthermore,
Runs a command (bash) in modified environment. In that environment the "python36u"'s binaries are first on the PATH. Exit from that shell, if you haven't already.
Code: Select all
# ls -l /usr/bin/python*
lrwxrwxrwx. 1 root root 7 Jul 23 14:51 /usr/bin/python -> python2
lrwxrwxrwx. 1 root root 9 Jul 23 14:51 /usr/bin/python2 -> python2.7
-rwxr-xr-x. 1 root root 7216 Jul 13 16:07 /usr/bin/python2.7
-rwxr-xr-x. 1 root root 1835 Jul 13 16:07 /usr/bin/python2.7-config
lrwxrwxrwx. 1 root root 16 Jul 23 14:54 /usr/bin/python2-config -> python2.7-config
lrwxrwxrwx. 1 root root 14 Jul 23 14:54 /usr/bin/python-config -> python2-config
the /usr/bin/python2.7 is a file.
The /usr/bin/python2 is a symbolic link to /usr/bin/python2.7
The /usr/bin/python is a symbolic link to /usr/bin/python2
What have you now?
Furthermore,
Code: Select all
scl enable python36u bash
Code: Select all
$ scl enable rh-python36 bash
$ ps af
PID TTY STAT TIME COMMAND
2040 pts/2 Ss 0:00 bash
2448 pts/2 S 0:00 \_ scl enable rh-python36 bash
2449 pts/2 S 0:00 \_ /bin/bash /var/tmp/sclKXjWJx
2452 pts/2 S 0:00 \_ bash
2543 pts/2 R+ 0:00 \_ ps af
$ exit
exit
$ ps af
PID TTY STAT TIME COMMAND
2040 pts/2 Ss 0:00 bash
3543 pts/2 R+ 0:00 \_ ps af