Yum problem after install new python

NethServer Version: 7.7.1908
Module: yum
Hi, I need some help. I really don’t know what to do next. When installing a new python on the nethserver. I wanted to keep the old and next to give a new one but this my action somehow damaged the yum. I fixed the problem in the terminal by adding LD_LIBRARY_PATH = / usr / lib64 yum to .bashrc and then yum worked again but only in the terminal. When I try to go to the Software Center, there is a message to clear the yum cache, which unfortunately is still there even though I read it through both the CLI and the button. Would anyone know what to do?

Thank you very much

Hi, can you share the commands ran to get to that point? You might get some clues from yum history command.

Also, can you share the list of currently installed yum/python packages:

rpm -qa python\* yum\*|sort

After the server runs fine again you can use python-scl module or review how to install different versions of python alongside the default one:

1 Like

Here is mi yum history

[root@plojhar ~]# yum history
Loaded plugins: changelog, fastestmirror, nethserver_events
ID | Login user | Date and time | Action(s) | Altered

36 | root <root>              | 2019-10-28 15:29 | Install        |   81   
35 | root <root>              | 2019-10-28 15:09 | I, U           |   20   
34 | root <root>              | 2019-10-28 15:08 | Update         |    1   
33 | root <root>              | 2019-10-28 14:29 | E, I, U        |   34 EE
32 | root <root>              | 2019-10-09 21:23 | E, I, O, U     |  260 E<
31 | root <root>              | 2019-10-06 10:36 | Erase          |    1 > 
30 | root <root>              | 2019-10-06 10:35 | Install        |   11   
29 | root <root>              | 2019-10-06 10:33 | Install        |   19   
28 | root <root>              | 2019-10-06 10:27 | Install        |    1   
27 | root <root>              | 2019-10-06 10:06 | Install        |    1   
26 | System <unset>           | 2019-10-05 21:36 | Update         |    1   
25 | System <unset>           | 2019-10-05 21:35 | Install        |    4   
24 | root <root>              | 2019-10-05 21:32 | Erase          |    1 EE
23 | root <root>              | 2019-10-05 21:28 | Update         |    1  <
22 | root <root>              | 2019-10-05 21:24 | Erase          |    1 >E
21 | root <root>              | 2019-10-05 21:14 | Install        |    1  <
20 | root <root>              | 2019-10-05 20:36 | Install        |   16 > 
19 | System <unset>           | 2019-10-03 16:25 | I, U           |    4   
18 | System <unset>           | 2019-09-25 07:15 | Update         |    6   
17 | root <root>              | 2019-09-17 10:31 | Install        |   14 EE

history list
[root@plojhar ~]#

And here is rpm -qa python* yum*|sort
[root@plojhar ~]# rpm -qa python* yum*|sort
[root@plojhar ~]#

It returns nothing.

I’m really dont know where is a problem.

If the problem happened the 28th, can you show the outcome of:

history |grep 2019-10-28

python -V

yum history info 33
yum history info 34
yum history info 35
yum history info 36

Log contains a lot of links I had to put the content on pastebin :frowning:
https://pastebin.com/VTX5n6LD

From the pastebin output I fail to see the process you took to install a new python version. Maybe it was done on a previous date, and maybe python was compiled and installed from source.

If yum still works from CLI, you might try to install the following packages, undoing .bashrc changes afterwards and relogin or rebooting the server to check if you get the correct python version (python -V) and yum works correctly:

# note: a multi-line command follows
yum reinstall python-2.7.5-86.el7.x86_64 \
python2-acme-0.39.0-1.el7.noarch \
python2-boto-2.45.0-3.el7.noarch \
python2-certbot-0.39.0-1.el7.noarch \
python2-configargparse-0.11.0-1.el7.noarch \
python2-cryptography-1.7.2-2.el7.x86_64 \
python2-distro-1.2.0-3.el7.noarch \
python2-future-0.16.0-15.20181019gitbee0f3b.el7.noarch \
python2-gflags-2.0-5.el7.noarch \
python2-google-api-client-1.6.3-1.el7.noarch \
python2-josepy-1.2.0-1.el7.noarch \
python2-keyring-5.0-4.el7.noarch \
python2-mock-1.0.1-10.el7.noarch \
python2-oauth2client-4.0.0-2.el7.noarch \
python2-parsedatetime-2.4-5.el7.noarch \
python2-pyasn1-0.1.9-7.el7.noarch \
python2-pyasn1-modules-0.1.9-7.el7.noarch \
python2-PyDrive-1.3.1-3.el7.noarch \
python2-pyrfc3339-1.0-2.el7.noarch \
python2-rsa-3.4.1-1.el7.noarch \
python2-simplejson-3.10.0-2.el7.x86_64 \
python2-six-1.9.0-0.el7.noarch \
python2-uritemplate-3.0.0-1.el7.noarch \
python-backports-1.0-8.el7.x86_64 \
python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch \
python-cffi-1.6.0-5.el7.x86_64 \
python-chardet-2.2.1-3.el7.noarch \
python-configobj-4.7.2-7.el7.noarch \
python-dateutil-1.5-7.el7.noarch \
python-decorator-3.4.0-3.el7.noarch \
python-enum34-1.0.4-1.el7.noarch \
python-fasteners-0.9.0-2.el7.noarch \
python-firewall-0.6.3-2.el7_7.2.noarch \
python-GnuPGInterface-0.3.2-11.el7.noarch \
python-gobject-base-3.22.0-1.el7_4.1.x86_64 \
python-httplib2-0.9.2-1.el7.noarch \
python-idna-2.4-1.el7.noarch \
python-iniparse-0.4-9.el7.noarch \
python-ipaddress-1.0.16-2.el7.noarch \
python-IPy-0.75-6.el7.noarch \
python-javapackages-3.4.1-11.el7.noarch \
python-libs-2.7.5-86.el7.x86_64 \
python-linux-procfs-0.4.11-4.el7.noarch \
python-lockfile-0.9.1-4.el7.centos.noarch \
python-lxml-3.2.1-4.el7.x86_64 \
python-ndg_httpsclient-0.3.2-1.el7.noarch \
python-paramiko-2.1.1-9.el7.noarch \
python-perf-3.10.0-1062.4.1.el7.x86_64 \
python-ply-3.4-11.el7.noarch \
python-pwquality-1.2.3-5.el7.x86_64 \
python-pycparser-2.14-1.el7.noarch \
python-pycurl-7.19.0-19.el7.x86_64 \
python-pyudev-0.15-9.el7.noarch \
python-requests-2.6.0-7.el7_7.noarch \
python-requests-toolbelt-0.8.0-1.el7.noarch \
python-schedutils-0.4-6.el7.x86_64 \
python-setuptools-0.9.8-7.el7.noarch \
python-six-1.9.0-2.el7.noarch \
python-slip-0.4.0-4.el7.noarch \
python-slip-dbus-0.4.0-4.el7.noarch \
python-sssdconfig-1.16.4-21.el7.noarch \
python-tdb-1.3.16-1.el7.x86_64 \
python-urlgrabber-3.10-9.el7.noarch \
python-urllib3-1.10.2-7.el7.noarch \
python-zope-component-4.1.0-5.el7.noarch \
python-zope-event-4.0.3-2.el7.noarch \
python-zope-interface-4.0.5-4.el7.x86_64 \
yum-3.4.3-163.el7.centos.noarch \
yum-cron-3.4.3-163.el7.centos.noarch \
yum-metadata-parser-1.1.4-10.el7.x86_64 \
yum-plugin-changelog-1.1.31-52.el7.noarch \
yum-plugin-fastestmirror-1.1.31-52.el7.noarch

Without having all the details its hard for me to say the best way to solve it (maybe other users have more experience with python or with this specific problem and can give you better advice). I would recommend having a backup before going any further in the troubleshooting process.

If python was compiled and you still have the folder with the sources you can check what it did with make -n install or make -n altinstall to try to manually revert the changes (with a lot of patience).


Here’s a similar problem and how that person fixed it:

waysquare script to manually delete python files
#!/bin/bash
prefix='/usr/local/'
pyver='2.7'
rm -rf -I \
    ${prefix}bin/python${pyver} \
    ${prefix}bin/pip${pyver} \
    ${prefix}bin/pydoc \
    ${prefix}bin/include/python${pyver} \
    ${prefix}lib/libpython${pyver}.a \
    ${prefix}lib/python${pyver} \
    ${prefix}bin/python${pyver} \
    ${prefix}bin/pip${pyver} \
    ${prefix}bin/include/python${pyver} \
    ${prefix}lib/libpython${pyver}.a \
    ${prefix}lib/python${pyver} \
    ${prefix}lib/pkgconfig/python-${pyver}.pc \
    ${prefix}lib/libpython${pyver}m.a \
    ${prefix}bin/python${pyver}m \
    ${prefix}bin/2to3-${pyver} \
    ${prefix}bin/python${pyver}m-config \
    ${prefix}bin/python${pyver}-config \
    ${prefix}bin/idle${pyver} \
    ${prefix}bin/pydoc${pyver} \
    ${prefix}bin/pyvenv-${pyver} \
    ${prefix}share/man/man1/python${pyver}.1 \
    ${prefix}include/python${pyver}m
#    ${prefix}bin/pydoc ## WARN: skip if other pythons in local exist.

if yum doesn’t work, downloading required packages (wget) from http://mirror.centos.org/centos-7/7/os/x86_64/Packages/
and installing them with something like rpm -Uvh --replacefiles --replacepkgs *.rpm or rpm -Uvh --force *.rpm
logout/login or reboot and check if it’s working