Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I recently was updating everything with up2date and I noticed that none of the glibc packages would update, but everything else would. So I went to RH's website and downloaded the glibc version 2.3.2-27.9 rpms, and tried to install them.
Somewhere in the installation of glibc-2.3.2-27.9.i386.rpm I effectively destroyed glibc, and now whenever I try to run most programs I get the error "Segmentation Fault".
I tried downloading a bzipped archive, but when I tried to untar it I got the same error, I had the same problem with a tarball.
Does anyone know how I can fix my system without having to reformat the hard drive?
But will that work if it didn't work with RPMs before?
Yes. Unless the rpm database is b0rken, it will work.
If nothing works, as a temporary fix, you could even copy the libraries from the cd to your system, run ldconfig and then see if it would work.
Also, what do you mean by pointing -root and how would I do it?
My root FS is on /dev/hdb2 if that helps.
"--root" is an option of rpm. When you boot the rescue cd Red hat will automagically mount your partitions in /mnt. Since the rpm database is in /var/lib/rpm on disk /dev/hdb2, you would point rpm to look there for information: "rpm --root /mnt/hdb2 <args>".
Hmm. Tricky problem. Rpmdb is the version running from the CD, so natually it would look at /usr/lib, because /mnt/sysimage/* doesn't exist until it's mounted and even then it's another version.
If you want to pursue installation tru rpm: what commandline did you run rpm with? Give us all the flags. Mount a floppy and copy the errors over and post 'em.
The other way would be running rpm2cpio. This WILL break the rpmdb, so once the system is up you will have to FORCE install the rpm again to sync it with the real situation. Also I make no guarantees it will work (but I guess it will).
Copy rpm and move to temp dir first, then run cpio on the glibc-2.3.2-27.9.i386.rpm: "rpm2cpio glibc-2.3.2-27.9.i386.rpm > glibc-2.3.2-27.9.i386.cpio" and extract the cpio archive: "cpio --make-directories --force-local --extract --no-absolute-filenames --verbose -F glibc-2.3.2-27.9.i386.cpio"
Now you got a tree you can copy over to /mnt/sysimage.
For Linux to recognize the files you need to run ldconfig.
First make a copy of the libs listed so you can verify it:
"ldconfig -r /mnt/sysimage -p 2>&1 > ldcache.0"
Now rebuild the cache:
"ldconfig -r /mnt/sysimage -v".
Verify: "ldconfig -r /mnt/sysimage -p 2>&1 > ldcache.1" then "diff -urN ldcache.0 ldcache.1". Glibc libs' version should have changed.
The system should be bootable now.
There are other ways to temporarily fix the situation but that should be reserved as a last effort attempt.
It just hit me that the RH 9 ISO may have finished downloading before I was forced to reboot the computer.. it did and I just rebooted into rescue mode with that CD.
Now I can install RPMs, and I installed glibc, glibc-common, glibc-devel, glibc-profile, glibc-utils, and nscd. Glibc-debug gave a servelet error when I tried to install it. (Those were the RPMs that I had originally tried to install, when I messed up glibc)
The RPMs seemed to install, but at the end I always got the error "rpmdb: /var/lib/rpm/Triggername no such file or directory"
Hopefully those were the right RPMs to install, what do I do next?
I tried running ldconfig using the directions you gave above, and the two files that I compared with diff were exactly the same.
Should I try running rpm2cpio? I don't mind breaking the database if that works, but if there's a better way to do it let me know.
Oh, and the command I used to install the RPMs was "rpm -r /mnt/sysimage/ -ivh glibc.rpm.name" and in some cases I had to use --force to force it.
Hopefully those were the right RPMs to install, what do I do next?
Check if the box will boot up?
I tried running ldconfig using the directions you gave above, and the two files that I compared with diff were exactly the same. Should I try running rpm2cpio?
I described two methods of trying to install stuff. I you installed using rpm then running ldconfig or rpm2cpio is not necessary.
I'd say at this point you better check if the box will boot up.
The missing file Triggername could mean the rpm database is slightly b0rken. See if you can repair it, then query for all rpm's/verify all rpms. If that works your rpm database seems OK.
It won't boot up, I tried that but forgot to mention it.
It says something about the run level spawning (I think that was the word it used) too quickly, and it says it disabled them for 5 minutes.
How would I repair the RPM database?
Also, when I do a query it says the glibc RPMs aren't installed. BUT if I query a RPM that I know is installed it says the RPM isn't installed, so it's probably just something with the database.
I also tried cpio, but when I got to the second step it didn't work.
If I type "cpio -- make-directories --force-local --extract --no-absolute-filenames --verbose -F glibc-2.3.2-27.9.i386.cpio" it doesn't do anything, and if I erase the space between -- and make-directores it gives me "-- - invalid option"
I found another copy of cpio on the system, and used that to create a directory tree in /home/andrew/tmp/, however when I tried "mv * /mnt/sysimage" it gave me errors saying it couldn't overwrite the directories in /mnt/sysimage/.
If I try "cp -R * /mnt/sysimage/" it give the error "Unable to link: file exists. <filename here>"
[Edit] It seems that the cp command on the rescue CD isn't the normal one, I used the normal one and it copied fine. Then I ran the ldconfig commands like you said to. The only difference diff found in the two files were things with libc6 in them. I rebooted anyway, and it still didn't work.
Maybe I need to install the version of glibc that came with RH9 instead of the new version? The old version is glibc-2.3.2-11.9, but I can't find any RPMs to install it with, and I don't have a way (besides floppys) of transferring it to the other computer.
What should I do?