I'm just using the free version of RHEL in my homelab, so do not have support with Red Hat. Same fix for CentOS should apply here...
I shouldn't have even tried to upgrade Python3, but hindsight is (as always) 20/20. This is what I'm getting when I try to use YUM:
[root@RHEL7 ~]# yum update
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory
[root@RHEL7 ~]# yum
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory
From reading about this error it seems I am going to have to completely reinstall Python2 and/or 3, but am wondering if there is any other fix. Both Python2 and Python3 actually still work fine (at least in the REPL):
[root@RHEL7 ~]# python3
Python 3.6.8 (default, Aug 13 2020, 07:46:32)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
[root@RHEL7 ~]# python2
Python 2.7.5 (default, Aug 13 2020, 02:51:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
This is what I get when I try to set Python2 as default (nothing returned, issue persists):
[root@RHEL7 bin]# update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
[root@RHEL7 bin]#
[root@RHEL7 bin]# yum
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory
Oddly enough Python2 already seems to be aliased to python but when I try just running python nothing happens...? The symlink is definitely already present:
[root@RHEL7 bin]# pwd
/usr/bin
[root@RHEL7 bin]# python
-bash: python: command not found
[root@RHEL7 bin]# ln -s python2 python
ln: failed to create symbolic link ‘python’: File exists
[root@RHEL7 bin]# ls -l python
lrwxrwxrwx 1 root root 24 Jul 9 11:30 python -> /etc/alternatives/python