1

I have a RHEL server which by default was running Python2.7 and Python3.4

I needed to use Python3.6 so I downloaded it and built it from source. However, now I seemed to have broken my network connectivity. I can still ssh into the box but none of my HTTPS calls are working which leads me to believe its related to an SSL lib.

After doing research I see that I should have done make altinstall instead of make install

Does anyone know how to reverse this, or where I may look for issues??

Joe
  • 151
  • 10
  • Sometimes, the `make install ` comand will create a list of the installed files. This list allow the execution of `make uninstall`, that will remove the installed files. Maybe you'll need to reinstall your distro's python packages, as some files could be overwriten. – JucaPirama Apr 17 '19 at 19:09
  • You can also try to bring your interfaces up manuallly, using `ip address` or `ifconfig` for setting the IP and `ip route` or `route` for setting the deafult gateway. – JucaPirama Apr 17 '19 at 19:14
  • The network is ok - I can ssh into the box. I just can't make outgoing https connections. I am thinking the SSL lib is broken – Joe Apr 17 '19 at 19:15
  • What are you trying to do (the comand ...)? Are you able to do a `nc google.com 443`? – JucaPirama Apr 17 '19 at 19:17
  • I am behind a restricted firewall. I can only hit certain sites. I have tried python requests, curl, wget to approved sites. All of which worked before i did this – Joe Apr 17 '19 at 19:18
  • @JucaPirama I have tried looking for the uninstall file but I do not think I have one – Joe Apr 17 '19 at 19:19
  • It isn't a file. It is a `make` target. Go to the python source dir where you executed the `make install` and try to run `make uninstall`. – JucaPirama Apr 17 '19 at 20:43
  • @JucaPirama I have tried that. No such luck :( – Joe Apr 17 '19 at 20:47
  • Someone said (in other post, sorry can't find the source now) to execute `make -n install`. This will simultate the install process, and show a list of files that would be copied and their destination. Maybe this can be a starting point. – JucaPirama Apr 17 '19 at 20:51
  • Also, you could try to identify the original installed python packages (something like `rpm -qa | grep python > /tmp/python.txt`) and reinstall them with `yum reinstall ` (something like `cat /tmp/python.txt | xargs yum -y reinstall`). This (I hope) should fix your python install and libs. – JucaPirama Apr 17 '19 at 20:57
  • @JucaPirama I tried the `make -n` command but it spits out way too much that is over my head. The other command looked promising but Yum is failing - Do you know of a way I can run `make` on python3.4 again? this is one of the versions the system started with and where I suspect the issue is stemming from – Joe Apr 17 '19 at 21:08
  • Check my previous comment about yum reinstall, for trying to reinstall your packages. – JucaPirama Apr 17 '19 at 21:11
  • @JucaPirama I tried the `yum reinstall` command but it error'd out. – Joe Apr 17 '19 at 21:13
  • I'm out of ideas here, sry. But the last thing comming to my mind is: as the only broken connectivity is related to python packages, you could try install python3.6 inside a virtual environment. It won't solve your main problem (system's python broken), but allows for running programs in a python3 environment isolated from the system. Take a look here: https://docs.python.org/3/library/venv.html – JucaPirama Apr 18 '19 at 11:27
  • Sorry maybe I wasn't clear but the system's connectivity is broken. I cannot `wget` or `curl` - Anyway, thank for the help I do appreciate it – Joe Apr 18 '19 at 12:12
  • EPEL is now on Python 3.6. You probably do not need to install from source. – Michael Hampton Apr 19 '19 at 15:52

2 Answers2

2

Try Red Hat Software Collections. The package is rh-python-36. In the rhscl repo and a python3 tutorial on the developer blog, so someone at Red Hat uses it.

Edit: as mentioned in the comments, python36 from EPEL gives you exactly that. So you have at least two choices specifically packaged for RHEL 7.

Installing from source is educational, but time consuming to sort out the dependencies. And reproducible builds are not always easy.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32
0

I managed to resolve the issue, but I am still not sure of the root cause. My best guess is that I installed 3.6 incorrectly (did not use altinstall) and I overwrote some critical python2 system links.

To resolve I fully removed Python3.6, fully removed Python3.4, and then removed and reinstalled 2.7. Once 2.7 was re-installed I had my connectivity back.

Joe
  • 151
  • 10