LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Accidental Deletion of some /usr/lib files (http://www.linuxquestions.org/questions/linux-general-1/accidental-deletion-of-some-usr-lib-files-111603/)

Huddlebum 11-02-2003 04:45 PM

Accidental Deletion of some /usr/lib files
 
I accidentally deleted some of my /usr/lib files, and am looking for a way to replace them if they need to be replaced.

It's a little bit of a long story, and I did have a reason, but I miscalculated which files I deleted.

I typed:
[root@localhost usr]# rm lib -r

and said yes to a bunch of questions before I realized that I didn't want to be deleting what I was deleting. What exactly is in /usr/lib? How can I replace the stuff I deleted.

In case this helps you, I did it again, making sure not to delete anything else, and this is what came out:
[root@localhost usr]# rm -r lib
rm: descend into directory `lib'? y
rm: descend into directory `lib/locale'? y
rm: descend into directory `lib/locale/ar_AE.utf8'? y
rm: remove regular file `lib/locale/ar_AE.utf8/LC_PAPER'?

So that is how far I got. Any help at all would be greatly appreciated.

I am a Linux newbie (using it for about 2 months on and off, about 2 weeks solid though), and I am so lost :cry:

linuxbotx 11-02-2003 04:53 PM

You are in major trouble pal. First off, find out what files have been deleted. The go to rpmfind.net and search for those lib files, download the rpm's and you should be able to get them back. Or go into "install/remove software", and remove your library files, and re-install them.

fsbooks 11-02-2003 05:05 PM

Try this:

# rpm -qa|while read pkg;do rpm -V "$pkg";done

This should verify each rpm in your current installation.

If you have any errors, you can reinstall that rpm.

Alternatively you could check your backup and see if you have any file differences... :-)

Huddlebum 11-02-2003 05:07 PM

linuxbot: I'm not sure I understand what you mean. I went to Add/Remove Applications, but I don't know where the Library files would be in that. I looked for them, and I couldn't find them.

fsbooks: okay, I'll try that.

linuxbotx 11-02-2003 05:43 PM

Its been a while since I used redhat. I know in Mandrake you can do a search for library files and you will get a list of all installed /usr/lib or /lib files. Thats why I don't like the redhat installer. No search option.

Huddlebum 11-02-2003 06:04 PM

oh boy, I can tell this is going to be bad:
was I just supposed to put the ones that said missing, or the others too?

missing /usr/lib/locale/af_ZA
missing /usr/lib/locale/af_ZA/LC_ADDRESS
missing /usr/lib/locale/af_ZA/LC_COLLATE
missing /usr/lib/locale/af_ZA/LC_CTYPE
missing /usr/lib/locale/af_ZA/LC_IDENTIFICATION
missing /usr/lib/locale/af_ZA/LC_MEASUREMENT
missing /usr/lib/locale/af_ZA/LC_MESSAGES
missing /usr/lib/locale/af_ZA/LC_MESSAGES/SYS_LC_MESSAGES
missing /usr/lib/locale/af_ZA/LC_MONETARY
missing /usr/lib/locale/af_ZA/LC_NAME
missing /usr/lib/locale/af_ZA/LC_NUMERIC
missing /usr/lib/locale/af_ZA/LC_PAPER
missing /usr/lib/locale/af_ZA/LC_TELEPHONE
missing /usr/lib/locale/af_ZA/LC_TIME
missing /usr/lib/locale/ar_AE
missing /usr/lib/locale/ar_AE.utf8/LC_IDENTIFICATION
missing /usr/lib/locale/ar_AE.utf8/LC_MEASUREMENT
missing /usr/lib/locale/ar_AE.utf8/LC_MESSAGES
missing /usr/lib/locale/ar_AE.utf8/LC_MESSAGES/SYS_LC_MESSAGES
missing /usr/lib/locale/ar_AE.utf8/LC_MONETARY
missing /usr/lib/locale/ar_AE.utf8/LC_TELEPHONE
missing /usr/lib/locale/ar_AE.utf8/LC_TIME
missing /usr/lib/locale/ar_AE/LC_ADDRESS
missing /usr/lib/locale/ar_AE/LC_COLLATE
missing /usr/lib/locale/ar_AE/LC_CTYPE
missing /usr/lib/locale/ar_AE/LC_IDENTIFICATION
missing /usr/lib/locale/ar_AE/LC_MEASUREMENT
missing /usr/lib/locale/ar_AE/LC_MESSAGES
missing /usr/lib/locale/ar_AE/LC_MESSAGES/SYS_LC_MESSAGES
missing /usr/lib/locale/ar_AE/LC_MONETARY
missing /usr/lib/locale/ar_AE/LC_NAME
missing /usr/lib/locale/ar_AE/LC_NUMERIC
missing /usr/lib/locale/ar_AE/LC_PAPER
missing /usr/lib/locale/ar_AE/LC_TELEPHONE
missing /usr/lib/locale/ar_AE/LC_TIME
missing /usr/X11R6/lib/modules/extensions/libGLcore.a
missing /usr/X11R6/lib/modules/extensions/libglx.a
missing /usr/X11R6/lib/libGL.so.1
missing /usr/X11R6/lib/libGL.so.1.2
missing /usr/X11R6/lib/libGL.a
missing /usr/X11R6/lib/libGL.so

:eek: I had no Idea that's what recursive did; I thought it just deleted what you told it to and all subdirectories within that. I didn't know it would search through my whole /usr folder and remove any directory with "lib" in it.
:cry: :cry: :cry:

By the way: I have a feeling I shouldn't close X if I want to get it back. Linuxquestions.org can be used from Lynx, right? Just in worst case scenario, like a power flash or something?

DavidPhillips 11-02-2003 08:20 PM

lib is the location of library files. THese files are very important to the programs that use them.


The command you used would not have removed files from /usr/X11R6/lib

something else is happening there.

Huddlebum 11-02-2003 08:41 PM

Are you sure? There were a few other missing files too, but they were in my /usr/java/j2sdk and /usr/java/j2re folders, and I know how to replace them. They were all in subfolders of /usr named lib too.

One question that is killing me: will X run correctly when I type startx? I am running it right now, but I generally reboot every now and then when XMMS starts acting funny.

Huddlebum 11-02-2003 09:04 PM

I just checked the bash history thingy, and I actually typed # rm -r lib

If that makes any difference...

DavidPhillips 11-02-2003 09:06 PM

if you are in /usr and type rm -r lib

this means /usr/lib

it will not find anything other than what's in /usr/lib


yes I'm sure

Huddlebum 11-02-2003 09:09 PM

okay, just checking. how will that stuff being gone affect my computer?
and I tried running that command again, and it didn't work. It just froze my TTY1 shell. I did #top and tried to kill it, but no avail.

DavidPhillips 11-02-2003 09:28 PM

there are a serious amount of files in /usr/lib

i guess you did not delete them all. I would try to find and replace what's missing in /usr/lib but ignore the others.

the libGL files are likely the result of a video driver update or something like that.

You will not be able to do this through the add remove programs GUI. You need to find the rpms and install them.

you can override errors with --force. I would use the same version as you have installed to get things going, then you can update files if you want.

If you have used up2date since install you should download any rpms that are updated with missing files from redhat network


example...


rpm -q --whatprovides /usr/lib/locale
glibc-common-2.3.2-27.9


rpm -i --force glibc-common-2.3.2-27.9

DavidPhillips 11-02-2003 09:30 PM

if rpm locks you might need to restart your system to fix it. May be another way if you can find it.

Huddlebum 11-02-2003 11:49 PM

I have RedHat 9.0 CDs 1 and 3 still. If it is on one of them, would that RPM be good to install from?

And yes, I did reinstall my video card drivers, so that would be why.

Thanks a lot man, you've been really helpful to me, and not treating me like I'm crap just because I'm new. It's pretty rare to see that anywhere online these days.

DavidPhillips 11-02-2003 11:55 PM

yes you can use the cdrom if you did not use up2date yet to update the rpms from the cd.


Quote:

It's pretty rare to see that anywhere online these days.
That's what makes this site the best.


All times are GMT -5. The time now is 09:21 AM.