Operating System - Linux
1829770 Members
3129 Online
109992 Solutions
New Discussion

Re: Unix commands like ls, rpm not working after I un-installed glibc

 
GnanaShekar
Regular Advisor

Unix commands like ls, rpm not working after I un-installed glibc

Hi,

We have a Suse 10 server.

lclnx7:~ # more /etc/SuSE-release
SUSE Linux Enterprise Server 10 (x86_64)
VERSION = 10

lclnx7:~ # uname -a
Linux lclnx7 2.6.16.21-0.8-smp #1 SMP Mon Jul 3 18:25:39 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux

There was a need to install new version of glibc. So I un-installed an existing version and after that, I am unable to run any unix commands like ls, rpm etc.

lclnx7:/tmp/glibc/26Oct2006 # rpm -ivh glibc-2.4-31.5.x86_64.rpm
Preparing... ########################################### [100%]
file /lib64/libc-2.4.so from install of glibc-2.4-31.5 conflicts with file from package glibc-2.4-31.3.PTF.193098
file /lib64/libpthread-2.4.so from install of glibc-2.4-31.5 conflicts with file from package glibc-2.4-31.3.PTF.193098
file /sbin/ldconfig from install of glibc-2.4-31.5 conflicts with file from package glibc-2.4-31.3.PTF.193098
file /usr/bin/getent from install of glibc-2.4-31.5 conflicts with file from package glibc-2.4-31.3.PTF.193098
file /usr/bin/locale from install of glibc-2.4-31.5 conflicts with file from package glibc-2.4-31.3.PTF.193098
file /usr/sbin/glibc_post_upgrade from install of glibc-2.4-31.5 conflicts with file from package glibc-2.4-31.3.PTF.193098

lclnx7:/tmp/glibc/26Oct2006 # rpm -ev --nodeps glibc-2.4-31.3.PTF.193098
warning: /etc/nsswitch.conf saved as /etc/nsswitch.conf.rpmsave
error: %postun(glibc-2.4-31.3.PTF.193098.x86_64) scriptlet failed, exit status 255

lclnx7:/tmp/glibc/26Oct2006 # rpm -qa | grep glibc-2.4-31.3.PTF.193098
-bash: /usr/bin/grep: No such file or directory
-bash: /bin/rpm: No such file or directory

lclnx7:/tmp/glibc/26Oct2006 # ls
-bash: /bin/ls: No such file or directory

How can I install a new version of glibc and get the system up and running again? Please suggest.

Thanks & Regards,
2 REPLIES 2
Patrick Terlisten
Honored Contributor

Re: Unix commands like ls, rpm not working after I un-installed glibc

Hello,

that was not a good idea, cause rpm, ls and many other programs are linked to glibc. This output is taken from a SUSE 10.0 server:

patrick@svr-lev-01:~> ldd /bin/ls
linux-gate.so.1 => (0xffffe000)
librt.so.1 => /lib/tls/librt.so.1 (0x40022000)
libacl.so.1 => /lib/libacl.so.1 (0x4002b000)
libselinux.so.1 => /lib/libselinux.so.1 (0x40032000)
libc.so.6 => /lib/tls/libc.so.6 (0x40042000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x40162000)
/lib/ld-linux.so.2 (0x40000000)
libattr.so.1 => /lib/libattr.so.1 (0x40174000)

patrick@svr-lev-01:~> ldd /bin/rpm
linux-gate.so.1 => (0xffffe000)
librpmbuild-4.1.so => /usr/lib/librpmbuild-4.1.so (0x40022000)
librpm-4.1.so => /usr/lib/librpm-4.1.so (0x40055000)
librpmdb-4.1.so => /usr/lib/librpmdb-4.1.so (0x400a5000)
librpmio-4.1.so => /usr/lib/librpmio-4.1.so (0x4019e000)
libpopt.so.0 => /usr/lib/libpopt.so.0 (0x401ee000)
librt.so.1 => /lib/tls/librt.so.1 (0x401f6000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x401fe000)
libz.so.1 => /lib/libz.so.1 (0x40211000)
libbz2.so.1 => /lib/libbz2.so.1 (0x40224000)
libc.so.6 => /lib/tls/libc.so.6 (0x40236000)
/lib/ld-linux.so.2 (0x40000000)

You can try to recover your server from backup. Maybe you can boot the resuce system from the installation cd and mount your root filesystem. Then try to install the GlibC package with rpm. Take a look to the manpage. You can set a prefix (--prefix $NEWPATH) for the installation. Try rpm -i --force --nodeps --prefix /mnt/yourootfs $PACKAGE.rpm.

Regards,
Patrick
Best regards,
Patrick
Atul Gautam
Valued Contributor

Re: Unix commands like ls, rpm not working after I un-installed glibc

Hi Gnana,

You will have to do exactly the same as what Patrick has suggested and in the future, kindly UPGRADE the packages using the command -- "rpm -Uvh "




Atul