LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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.

Notices

Reply
 
Search this Thread
Old 11-02-2003, 04:45 PM   #1
Huddlebum
Member
 
Registered: Nov 2003
Distribution: RedHat 9.0
Posts: 45

Rep: Reputation: 15
Unhappy 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
 
Old 11-02-2003, 04:53 PM   #2
linuxbotx
Member
 
Registered: Oct 2003
Location: USA
Distribution: Fedora Core 4
Posts: 247

Rep: Reputation: 30
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.
 
Old 11-02-2003, 05:05 PM   #3
fsbooks
Member
 
Registered: Jan 2002
Location: Missoula. Montana, USA
Distribution: fedora, slackware, suse
Posts: 447

Rep: Reputation: 31
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... :-)
 
Old 11-02-2003, 05:07 PM   #4
Huddlebum
Member
 
Registered: Nov 2003
Distribution: RedHat 9.0
Posts: 45

Original Poster
Rep: Reputation: 15
Question

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.

Last edited by Huddlebum; 11-02-2003 at 05:08 PM.
 
Old 11-02-2003, 05:43 PM   #5
linuxbotx
Member
 
Registered: Oct 2003
Location: USA
Distribution: Fedora Core 4
Posts: 247

Rep: Reputation: 30
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.
 
Old 11-02-2003, 06:04 PM   #6
Huddlebum
Member
 
Registered: Nov 2003
Distribution: RedHat 9.0
Posts: 45

Original Poster
Rep: Reputation: 15
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

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.


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?

Last edited by Huddlebum; 11-02-2003 at 06:11 PM.
 
Old 11-02-2003, 08:20 PM   #7
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
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.
 
Old 11-02-2003, 08:41 PM   #8
Huddlebum
Member
 
Registered: Nov 2003
Distribution: RedHat 9.0
Posts: 45

Original Poster
Rep: Reputation: 15
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.

Last edited by Huddlebum; 11-02-2003 at 08:49 PM.
 
Old 11-02-2003, 09:04 PM   #9
Huddlebum
Member
 
Registered: Nov 2003
Distribution: RedHat 9.0
Posts: 45

Original Poster
Rep: Reputation: 15
I just checked the bash history thingy, and I actually typed # rm -r lib

If that makes any difference...
 
Old 11-02-2003, 09:06 PM   #10
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
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
 
Old 11-02-2003, 09:09 PM   #11
Huddlebum
Member
 
Registered: Nov 2003
Distribution: RedHat 9.0
Posts: 45

Original Poster
Rep: Reputation: 15
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.

Last edited by Huddlebum; 11-02-2003 at 09:15 PM.
 
Old 11-02-2003, 09:28 PM   #12
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
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
 
Old 11-02-2003, 09:30 PM   #13
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
if rpm locks you might need to restart your system to fix it. May be another way if you can find it.
 
Old 11-02-2003, 11:49 PM   #14
Huddlebum
Member
 
Registered: Nov 2003
Distribution: RedHat 9.0
Posts: 45

Original Poster
Rep: Reputation: 15
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.
 
Old 11-02-2003, 11:55 PM   #15
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compromised? Files "/usr/lib.hwm", "/usr/lib.pwd", "/usr/lib.pwi" Klaus Pforte Linux - Security 4 09-28-2004 11:33 PM
Installing software, /usr/lib directory and /usr/local millertime Linux - Software 2 07-10-2004 09:21 AM
accidental deletion of /etc/profile on MDK9.2 lolmc Mandriva 2 05-06-2004 12:49 PM
Accidental Deletion of "home.desktop" Ian Linux - Newbie 2 03-06-2004 11:36 AM
accidental deletion of /bin/ steve1394 Linux - Newbie 3 11-03-2003 02:06 PM


All times are GMT -5. The time now is 06:03 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration