We have moved to a new Sailfish OS Forum. Please start new discussions there.
0

[Answered] How to restore .desktop files ? [answered]

asked 2015-01-13 23:23:52 +0200

Schturman gravatar image

updated 2015-01-14 03:53:17 +0200

Hi By mistake I deleted all files from this directory: /usr/share/applications

Any way to restore them without full factory reset and setup/reinstall all my stuff again ? Maybe some catch files of ".desktop" files located somewhere ? :D Thanks

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by eric
close date 2015-01-14 12:21:47.370608

Comments

Oops! :D

Have a look in /home/nemo/.config/lipstick/applications.menu

EDIT: - I realise you may only be looking at a list and not a way to restore, but at least you should be able to see what needs to be downloaded/reinstalled again - assuming the file didn't get 'blanked' when you deleted 'applications'.

Regards,

Spam Hunter ( 2015-01-14 00:06:05 +0200 )edit

Thanks, it's already blank :D Demn...

Schturman ( 2015-01-14 00:14:26 +0200 )edit

Maybe a command to see only user-installed apps (.rpm) ?

Schturman ( 2015-01-14 00:15:42 +0200 )edit

Looks like you have much downloading and installing to do brother!, unless some really bright spark on here can come to your rescue!!, good luck, I hope you get sorted soon! :)

Spam Hunter ( 2015-01-14 00:19:04 +0200 )edit

Yes, possibly - I'm not sure how though, I only know how to search for named applications. ( pkcon search name blahblah )

Spam Hunter ( 2015-01-14 00:21:37 +0200 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2015-01-14 01:58:15 +0200

penpen gravatar image

updated 2015-01-14 01:59:55 +0200

In theory you can try something like this:

  • rpm -Va | grep missing > /tmp/missing
  • awk '{print $2}' < /tmp/missing | xargs -n1 rpm -qf | sort -u > /tmp/packages
  • mkdir ~nemo/downloaded
  • xargs pkcon download ~nemo/downloaded < /tmp/packages
  • cd ~nemo/downloaded
  • ls -l

And then for each package file in ~nemo/downloaded: rpm --replacepkgs -ivh PACKAGEFILE

You could also automate the last step but I would be little cautious on that because it modifies the system.

No batteries included and no warranty.

edit flag offensive delete publish link more

Comments

1

Already fixed all, just need to reorganize my icons. But your solution looks intresting, thanks. Will try it in the next time when I will kill my device again :)

P.S. Decided to try :D I changed a little bit your command specifically to my needs:

rpm -Va|grep missing|grep ".desktop"|awk '{print $2}' > /home/nemo/Templates/missing
cat /home/nemo/Templates/missing|xargs -n1 rpm -qif|grep Name|awk '{print $3}'|sort -u > /home/nemo/Templates/packages
xargs pkcon download /home/nemo/Templates < /home/nemo/Templates/packages
Schturman ( 2015-01-14 03:48:50 +0200 )edit

Question tools

Follow
1 follower

Stats

Asked: 2015-01-13 23:23:52 +0200

Seen: 249 times

Last updated: Jan 14 '15