Dan-cer wrote: ⤴Tue Aug 30, 2022 5:45 am
[...]
Oh wow, 8 different '.desktop' files for one application is usually wholly unnecessary, and might've been a bug from updates not replacing the original file. You had the right idea, TBH. I would've done the same thing and expected nothing to go wrong. Cinnamon maybe has a specific process involving those files, for some reason. Actually, I have a Cinnamon virtual machine, so I'm gonna go quickly try that...
I deleted the entire '/usr/share/applications' directory. After relogging, I got an error dialog saying it failed to load the Cinnamon session, so I guess it's something specific to how Cinnamon is setup (the aforementioned oversight),
or it's something tied to how traditional DEs work. Don't worry, I have a backup.
Unfortunately, I can't think of a simple way to get back the '.desktop' files. The only thing which comes to mind is for someone to write a script to go through all of the packages for '.desktop' files in order to redownload and install just those files, but that doesn't account for one installed by other means. Hopefully Cinnamon can address this, because it's definitely a problem, if just one program or user does some such thing with such a file.
Something like the following could be involved, to grab a list of all of the '.desktop' files which should've been installed.
Code: Select all
for PKG in `dpkg -l | grep '^ii' | cut -d ' ' -f 3`; { dpkg -L "$PKG"; } | grep '^/usr/share/applications/'
Then you could determine from what packages those files are installed, use apt-get(8)'s
--print-uris
flag to grab the URLs — oh you know what, the whole thing is way too convoluted for this message.
Point is, there is a way, but it's not a 3 second task.