Python issues on CentOS - error loading shared libraries - libpython2.7.so.1.0












3















One of our CentOS servers has went into a strange state and is complaining that libpython2.7.so.1.0 cannot open shared object files. Yum is unusable and other features are failing to function (such as sending mail from the system, SSH'ing to it etc.) I really don't want to have to rebuild the server from scratch and I'm hoping someone can advise on a fix for me.



An example of the error I am presented with when running Yum:



/usr/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory


I cannot use the pipe symbol (as I am having to manage the system via VMware console) and I cannot copy text from this console either, so if you require me to run any commands I will have to type the results out manually.



Answers to the questions asked on Stack Overflow:



Typing python into the CLI still works and opens Python (note the date/time stamp below is when this stopped working!):



Python 2.7.15 (default, Jun 18 2018, 08:40:16) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
>>>


Typing rpm --verify -a into the CLI returns the following:



$ rpm --verify -a
rpm: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory









share|improve this question

























  • Do either of those library files exist on the system? As root, you can find them by first running updatedb and then locate libpython2.7.so.1.0 and locate libnss3.so. If they aren't there then that's where your problem is.

    – Nasir Riley
    Jul 6 '18 at 14:00













  • updatedb is not a command which is found. Neither is locate. We have done 'find / -name libnss3.so' but this returned no results. This system worked previously until a yum update was ran (and crashed).

    – Tom Whitfield
    Jul 6 '18 at 14:06











  • You can compile Python from source (takes about 5 mins), copy the compiled libpython2.7.so.1.0 from selected prefix to /usr/lib64 and reinstall the python dist package with yum. Thing is, it looks like libpython2.7 is not the only lib you're missing, if yum will require more libs, you can end up in compiling a bunch of libs from source in order to make yum usable again. But at least try compiling this one, maybe it will already suffice.

    – hoefling
    Jul 6 '18 at 15:23











  • If the find command didn't locate it then it's not there which is your issue. The easiest solution is to build it from source.

    – Nasir Riley
    Jul 6 '18 at 15:33











  • You mentioned the date in the Python interpreter (Jun 18 2018) is when everything stopped working. Did someone attempt to upgrade the system's Python version manually? I do not see that Redhat/CentOS offers Python v2.7.15 as their current Python version is pinned to 2.7.5. Fixing that would require getting the system provided Python back onto the server. Since you want to avoid rebuilding, you could mount the disk on a working CentOS machine, use yum --installroot=/where/you/mounted/your/disk and make sure all the proper Python packages are put back in place.

    – GracefulRestart
    Jul 6 '18 at 22:38
















3















One of our CentOS servers has went into a strange state and is complaining that libpython2.7.so.1.0 cannot open shared object files. Yum is unusable and other features are failing to function (such as sending mail from the system, SSH'ing to it etc.) I really don't want to have to rebuild the server from scratch and I'm hoping someone can advise on a fix for me.



An example of the error I am presented with when running Yum:



/usr/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory


I cannot use the pipe symbol (as I am having to manage the system via VMware console) and I cannot copy text from this console either, so if you require me to run any commands I will have to type the results out manually.



Answers to the questions asked on Stack Overflow:



Typing python into the CLI still works and opens Python (note the date/time stamp below is when this stopped working!):



Python 2.7.15 (default, Jun 18 2018, 08:40:16) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
>>>


Typing rpm --verify -a into the CLI returns the following:



$ rpm --verify -a
rpm: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory









share|improve this question

























  • Do either of those library files exist on the system? As root, you can find them by first running updatedb and then locate libpython2.7.so.1.0 and locate libnss3.so. If they aren't there then that's where your problem is.

    – Nasir Riley
    Jul 6 '18 at 14:00













  • updatedb is not a command which is found. Neither is locate. We have done 'find / -name libnss3.so' but this returned no results. This system worked previously until a yum update was ran (and crashed).

    – Tom Whitfield
    Jul 6 '18 at 14:06











  • You can compile Python from source (takes about 5 mins), copy the compiled libpython2.7.so.1.0 from selected prefix to /usr/lib64 and reinstall the python dist package with yum. Thing is, it looks like libpython2.7 is not the only lib you're missing, if yum will require more libs, you can end up in compiling a bunch of libs from source in order to make yum usable again. But at least try compiling this one, maybe it will already suffice.

    – hoefling
    Jul 6 '18 at 15:23











  • If the find command didn't locate it then it's not there which is your issue. The easiest solution is to build it from source.

    – Nasir Riley
    Jul 6 '18 at 15:33











  • You mentioned the date in the Python interpreter (Jun 18 2018) is when everything stopped working. Did someone attempt to upgrade the system's Python version manually? I do not see that Redhat/CentOS offers Python v2.7.15 as their current Python version is pinned to 2.7.5. Fixing that would require getting the system provided Python back onto the server. Since you want to avoid rebuilding, you could mount the disk on a working CentOS machine, use yum --installroot=/where/you/mounted/your/disk and make sure all the proper Python packages are put back in place.

    – GracefulRestart
    Jul 6 '18 at 22:38














3












3








3








One of our CentOS servers has went into a strange state and is complaining that libpython2.7.so.1.0 cannot open shared object files. Yum is unusable and other features are failing to function (such as sending mail from the system, SSH'ing to it etc.) I really don't want to have to rebuild the server from scratch and I'm hoping someone can advise on a fix for me.



An example of the error I am presented with when running Yum:



/usr/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory


I cannot use the pipe symbol (as I am having to manage the system via VMware console) and I cannot copy text from this console either, so if you require me to run any commands I will have to type the results out manually.



Answers to the questions asked on Stack Overflow:



Typing python into the CLI still works and opens Python (note the date/time stamp below is when this stopped working!):



Python 2.7.15 (default, Jun 18 2018, 08:40:16) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
>>>


Typing rpm --verify -a into the CLI returns the following:



$ rpm --verify -a
rpm: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory









share|improve this question
















One of our CentOS servers has went into a strange state and is complaining that libpython2.7.so.1.0 cannot open shared object files. Yum is unusable and other features are failing to function (such as sending mail from the system, SSH'ing to it etc.) I really don't want to have to rebuild the server from scratch and I'm hoping someone can advise on a fix for me.



An example of the error I am presented with when running Yum:



/usr/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory


I cannot use the pipe symbol (as I am having to manage the system via VMware console) and I cannot copy text from this console either, so if you require me to run any commands I will have to type the results out manually.



Answers to the questions asked on Stack Overflow:



Typing python into the CLI still works and opens Python (note the date/time stamp below is when this stopped working!):



Python 2.7.15 (default, Jun 18 2018, 08:40:16) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
>>>


Typing rpm --verify -a into the CLI returns the following:



$ rpm --verify -a
rpm: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory






centos python yum






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 9 at 9:22









Rui F Ribeiro

41.8k1483142




41.8k1483142










asked Jul 6 '18 at 13:36









Tom WhitfieldTom Whitfield

162




162













  • Do either of those library files exist on the system? As root, you can find them by first running updatedb and then locate libpython2.7.so.1.0 and locate libnss3.so. If they aren't there then that's where your problem is.

    – Nasir Riley
    Jul 6 '18 at 14:00













  • updatedb is not a command which is found. Neither is locate. We have done 'find / -name libnss3.so' but this returned no results. This system worked previously until a yum update was ran (and crashed).

    – Tom Whitfield
    Jul 6 '18 at 14:06











  • You can compile Python from source (takes about 5 mins), copy the compiled libpython2.7.so.1.0 from selected prefix to /usr/lib64 and reinstall the python dist package with yum. Thing is, it looks like libpython2.7 is not the only lib you're missing, if yum will require more libs, you can end up in compiling a bunch of libs from source in order to make yum usable again. But at least try compiling this one, maybe it will already suffice.

    – hoefling
    Jul 6 '18 at 15:23











  • If the find command didn't locate it then it's not there which is your issue. The easiest solution is to build it from source.

    – Nasir Riley
    Jul 6 '18 at 15:33











  • You mentioned the date in the Python interpreter (Jun 18 2018) is when everything stopped working. Did someone attempt to upgrade the system's Python version manually? I do not see that Redhat/CentOS offers Python v2.7.15 as their current Python version is pinned to 2.7.5. Fixing that would require getting the system provided Python back onto the server. Since you want to avoid rebuilding, you could mount the disk on a working CentOS machine, use yum --installroot=/where/you/mounted/your/disk and make sure all the proper Python packages are put back in place.

    – GracefulRestart
    Jul 6 '18 at 22:38



















  • Do either of those library files exist on the system? As root, you can find them by first running updatedb and then locate libpython2.7.so.1.0 and locate libnss3.so. If they aren't there then that's where your problem is.

    – Nasir Riley
    Jul 6 '18 at 14:00













  • updatedb is not a command which is found. Neither is locate. We have done 'find / -name libnss3.so' but this returned no results. This system worked previously until a yum update was ran (and crashed).

    – Tom Whitfield
    Jul 6 '18 at 14:06











  • You can compile Python from source (takes about 5 mins), copy the compiled libpython2.7.so.1.0 from selected prefix to /usr/lib64 and reinstall the python dist package with yum. Thing is, it looks like libpython2.7 is not the only lib you're missing, if yum will require more libs, you can end up in compiling a bunch of libs from source in order to make yum usable again. But at least try compiling this one, maybe it will already suffice.

    – hoefling
    Jul 6 '18 at 15:23











  • If the find command didn't locate it then it's not there which is your issue. The easiest solution is to build it from source.

    – Nasir Riley
    Jul 6 '18 at 15:33











  • You mentioned the date in the Python interpreter (Jun 18 2018) is when everything stopped working. Did someone attempt to upgrade the system's Python version manually? I do not see that Redhat/CentOS offers Python v2.7.15 as their current Python version is pinned to 2.7.5. Fixing that would require getting the system provided Python back onto the server. Since you want to avoid rebuilding, you could mount the disk on a working CentOS machine, use yum --installroot=/where/you/mounted/your/disk and make sure all the proper Python packages are put back in place.

    – GracefulRestart
    Jul 6 '18 at 22:38

















Do either of those library files exist on the system? As root, you can find them by first running updatedb and then locate libpython2.7.so.1.0 and locate libnss3.so. If they aren't there then that's where your problem is.

– Nasir Riley
Jul 6 '18 at 14:00







Do either of those library files exist on the system? As root, you can find them by first running updatedb and then locate libpython2.7.so.1.0 and locate libnss3.so. If they aren't there then that's where your problem is.

– Nasir Riley
Jul 6 '18 at 14:00















updatedb is not a command which is found. Neither is locate. We have done 'find / -name libnss3.so' but this returned no results. This system worked previously until a yum update was ran (and crashed).

– Tom Whitfield
Jul 6 '18 at 14:06





updatedb is not a command which is found. Neither is locate. We have done 'find / -name libnss3.so' but this returned no results. This system worked previously until a yum update was ran (and crashed).

– Tom Whitfield
Jul 6 '18 at 14:06













You can compile Python from source (takes about 5 mins), copy the compiled libpython2.7.so.1.0 from selected prefix to /usr/lib64 and reinstall the python dist package with yum. Thing is, it looks like libpython2.7 is not the only lib you're missing, if yum will require more libs, you can end up in compiling a bunch of libs from source in order to make yum usable again. But at least try compiling this one, maybe it will already suffice.

– hoefling
Jul 6 '18 at 15:23





You can compile Python from source (takes about 5 mins), copy the compiled libpython2.7.so.1.0 from selected prefix to /usr/lib64 and reinstall the python dist package with yum. Thing is, it looks like libpython2.7 is not the only lib you're missing, if yum will require more libs, you can end up in compiling a bunch of libs from source in order to make yum usable again. But at least try compiling this one, maybe it will already suffice.

– hoefling
Jul 6 '18 at 15:23













If the find command didn't locate it then it's not there which is your issue. The easiest solution is to build it from source.

– Nasir Riley
Jul 6 '18 at 15:33





If the find command didn't locate it then it's not there which is your issue. The easiest solution is to build it from source.

– Nasir Riley
Jul 6 '18 at 15:33













You mentioned the date in the Python interpreter (Jun 18 2018) is when everything stopped working. Did someone attempt to upgrade the system's Python version manually? I do not see that Redhat/CentOS offers Python v2.7.15 as their current Python version is pinned to 2.7.5. Fixing that would require getting the system provided Python back onto the server. Since you want to avoid rebuilding, you could mount the disk on a working CentOS machine, use yum --installroot=/where/you/mounted/your/disk and make sure all the proper Python packages are put back in place.

– GracefulRestart
Jul 6 '18 at 22:38





You mentioned the date in the Python interpreter (Jun 18 2018) is when everything stopped working. Did someone attempt to upgrade the system's Python version manually? I do not see that Redhat/CentOS offers Python v2.7.15 as their current Python version is pinned to 2.7.5. Fixing that would require getting the system provided Python back onto the server. Since you want to avoid rebuilding, you could mount the disk on a working CentOS machine, use yum --installroot=/where/you/mounted/your/disk and make sure all the proper Python packages are put back in place.

– GracefulRestart
Jul 6 '18 at 22:38










1 Answer
1






active

oldest

votes


















0














Usually, when I have a shared libraries issue, I use yum provides to install those. For example:



$ sudo yum provides libpython2.7.so.1.0
[sudo] password
Loaded plugins: nvidia
python-libs-2.7.5-68.el7.i686 : Runtime libraries for Python
Repo : base
Matched from:
Provides : libpython2.7.so.1.0


So, to be able to do that, I suggest I remove yum and reinstall it using rpm package:



$ sudo rpm -e yum

#download yum.rpm
$ sudo rpm -ivh yum.rpm


You can download yum rpm package from here. You might also need to remove packages linked to yum like yum-utils...






share|improve this answer


























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f453856%2fpython-issues-on-centos-error-loading-shared-libraries-libpython2-7-so-1-0%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Usually, when I have a shared libraries issue, I use yum provides to install those. For example:



    $ sudo yum provides libpython2.7.so.1.0
    [sudo] password
    Loaded plugins: nvidia
    python-libs-2.7.5-68.el7.i686 : Runtime libraries for Python
    Repo : base
    Matched from:
    Provides : libpython2.7.so.1.0


    So, to be able to do that, I suggest I remove yum and reinstall it using rpm package:



    $ sudo rpm -e yum

    #download yum.rpm
    $ sudo rpm -ivh yum.rpm


    You can download yum rpm package from here. You might also need to remove packages linked to yum like yum-utils...






    share|improve this answer






























      0














      Usually, when I have a shared libraries issue, I use yum provides to install those. For example:



      $ sudo yum provides libpython2.7.so.1.0
      [sudo] password
      Loaded plugins: nvidia
      python-libs-2.7.5-68.el7.i686 : Runtime libraries for Python
      Repo : base
      Matched from:
      Provides : libpython2.7.so.1.0


      So, to be able to do that, I suggest I remove yum and reinstall it using rpm package:



      $ sudo rpm -e yum

      #download yum.rpm
      $ sudo rpm -ivh yum.rpm


      You can download yum rpm package from here. You might also need to remove packages linked to yum like yum-utils...






      share|improve this answer




























        0












        0








        0







        Usually, when I have a shared libraries issue, I use yum provides to install those. For example:



        $ sudo yum provides libpython2.7.so.1.0
        [sudo] password
        Loaded plugins: nvidia
        python-libs-2.7.5-68.el7.i686 : Runtime libraries for Python
        Repo : base
        Matched from:
        Provides : libpython2.7.so.1.0


        So, to be able to do that, I suggest I remove yum and reinstall it using rpm package:



        $ sudo rpm -e yum

        #download yum.rpm
        $ sudo rpm -ivh yum.rpm


        You can download yum rpm package from here. You might also need to remove packages linked to yum like yum-utils...






        share|improve this answer















        Usually, when I have a shared libraries issue, I use yum provides to install those. For example:



        $ sudo yum provides libpython2.7.so.1.0
        [sudo] password
        Loaded plugins: nvidia
        python-libs-2.7.5-68.el7.i686 : Runtime libraries for Python
        Repo : base
        Matched from:
        Provides : libpython2.7.so.1.0


        So, to be able to do that, I suggest I remove yum and reinstall it using rpm package:



        $ sudo rpm -e yum

        #download yum.rpm
        $ sudo rpm -ivh yum.rpm


        You can download yum rpm package from here. You might also need to remove packages linked to yum like yum-utils...







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jul 6 '18 at 15:24









        slm

        255k71539687




        255k71539687










        answered Jul 6 '18 at 14:08









        Kevin LemaireKevin Lemaire

        1,182724




        1,182724






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f453856%2fpython-issues-on-centos-error-loading-shared-libraries-libpython2-7-so-1-0%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to make a Squid Proxy server?

            Is this a new Fibonacci Identity?

            19世紀