LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 01-13-2010, 01:07 PM   #1
MartinKuyu
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Rep: Reputation: 0
Exclamation Urgent! Help me restore this folder


I was recently installing a a package and in due course, I typed by mistake the following code in a terminal:

sudo rm -r /usr/share/applications/

Now all my program shortcuts are gone and my gnome terminal as well as icons,and panels are not accessible as a root user....(Thank god I was using AWN on my current account!)

Can anyone help me restore the folder because from the terminal, the command says it possible.
 
Old 01-13-2010, 01:36 PM   #2
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
You said 'recently', so does it follow it was just the gnome thing that it puts in automatically? You know you hadn't changed it much.

In which case just reinstall Gnome seems the simple course.

Is gnome a 'metapackage' or whatever they are called. In which case:
Code:
sudo apt-get install --reinstall gnome
Hope helps.

EDIT: Sorry that was a bit crass even by my usual standards. You've presumably removed all your *.desktop files. The above suggestion might still be worth a try. Or try recovering the directory with some sort of recovery program, but its likely to be a bit iffy.

Last edited by lugoteehalt; 01-13-2010 at 01:55 PM.
 
Old 01-14-2010, 03:53 AM   #3
MartinKuyu
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks a lot. Re-installing gnome has at least returned most functionality, but I am still missing my .desktop icons. I have tried to get recovery software but apparently none exit for Linux.
 
Old 01-14-2010, 04:08 AM   #4
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Debian, SL
Posts: 5,202

Rep: Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121
Quote:
Originally Posted by lugoteehalt View Post
Is gnome a 'metapackage' or whatever they are called. In which case:
Code:
sudo apt-get install --reinstall gnome
Hope helps.
Interesting. I'd have thought that if it was a meta package, the above, would not do much at all. Since the "gnome" package that is being reinstalled would not actually have any files.

I'd probably try something like:

Code:
sudo apt-get install --reinstall $(dpkg -l '*gnome*' | grep ^ii | awk '{ print $2 }')
Or, if dlocate is installed:

Code:
sudo apt-get install --reisntall $(dlocate /usr/share/applications/  | cut -f1 -d':' | sort | uniq)

Cheers,

Evo2.

Last edited by evo2; 01-14-2010 at 04:12 AM. Reason: dlocate method
 
Old 01-14-2010, 02:40 PM   #5
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Quote:
Originally Posted by MartinKuyu View Post
Thanks a lot. Re-installing gnome has at least returned most functionality, but I am still missing my .desktop icons. I have tried to get recovery software but apparently none exit for Linux.
If you've been using the computer for a bit since the incident the accidentally deleted directory is probably long gone. There is recovery software for example: http://www.data-recovery-software.ne...Recovery.shtml I have no idea whether it is any good or not.

You mean icons showing on the desktop, the root window as twer? Don't know but it should be simple - start a program and then drag its icon onto the desktop, that sort of thing.
 
Old 01-14-2010, 02:56 PM   #6
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by MartinKuyu View Post
Thanks a lot. Re-installing gnome has at least returned most functionality, but I am still missing my .desktop icons. I have tried to get recovery software but apparently none exit for Linux.
Desktop icons are probably not even worth the effort of trying to recover them, but for the record, there ARE recovery tools for Linux, including PhotoRec, Test-disk (I think that's a recovery tool, if not an assistant), and Recover, to name a few. Of course, using any given tool for recovery, is influenced by (A) how much use the machine has had since the loss, and (B) what filesystem is in question.

Sasha
 
Old 01-14-2010, 03:33 PM   #7
MartinKuyu
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Unhappy

...Thanks for all the help. Al least functionality has been restored and i can use my root account.

Last edited by MartinKuyu; 01-14-2010 at 03:40 PM.
 
  


Reply

Tags
folder, icons, restore


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to restore default Ownership for every folder in Linux. RMLinux Linux - Newbie 4 11-26-2008 02:25 AM
how to restore a folder dody1313 Solaris / OpenSolaris 6 05-31-2008 09:58 AM
Really Urgent : How to restore desktop icons of JBuilder in Linux? Ghazala Linux - Software 1 12-20-2003 11:23 AM


All times are GMT -5. The time now is 04:58 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