My Linux server seems to be broken. I can't do yum, rpm or neither can start any services

It throws out following error, everything time I try to do anything related installation.

error while loading shared libraries: libz.so.1: cannot open shared object file

I am not able to fix the issue. Need help ASAP.

  • 1
    show the output of ls -l /lib64/libz*. – user9517 supports GoFundMonica Nov 9 '15 at 7:35
  • ls: can't access /lib64/libz*: no such file or directory – Pravin Nov 9 '15 at 11:44

You don't say which version of Red Hat you are using so I will assume a recent version of EL6. If you are using a different version you will need to figure out exactly what the filenames are yourself.

To fix this you need to put a copy of libz.so.1.2.3 into /lib64 and soft link libz.so.1 to it.

As you can't use the package system you are going to have to try to do it manually and even then it may be too difficult to solve.

From a similarly configured system get a copy of the file that /lib64/ libz.so.1 points to

ls -l /lib64/libz*
lrwxrwxrwx. 1 root root    13 Nov  9 12:21 /lib64/libz.so.1 -> libz.so.1.2.3
-rwxr-xr-x. 1 root root 91096 Nov  9 12:21 /lib64/libz.so.1.2.3

in this case it is /lib64/libz.so.1.2.3 so that's the name of the file you need to get onto your system.

Once you have a copy of libz.so.1.2.3 on the system

cp libz.so.1.2.3 /lib64
cd /lib64
ln -s libz.so.1.2.3 libz.so.1

Now you should be back in business.

Getting the library back onto the system is the hard thing here you can

  • Boot the installation media and use Troubleshooting to get to it.
  • Thanks lain....Your first question hinted me out what I needed to do and fixed it. – Pravin Nov 10 '15 at 4:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.