Score:2

The databases in /usr/share/applications cannot be updated

al flag

I m trying to perform File association to register my custom file extension for my application(ex: if I do xdg-open myFile.myExtension, it should launch my app). I m following this link to do it. I have created a .desktop file under the location /usr/share/applications. Now to update the desktop database If I run the command: update-desktop-database /usr/share/applications, then it does not update the database and says:

The databases in /usr/share/applications cannot be updated

How can I resolve this? This is my StartupLinux.desktop file:

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=true
MimeType=application/x-demo
Name=StartupLinux
Exec=/home/<user>/MyWorkspace/StartupLinux %f

/home//MyWorkspace/StartupLinux.sh successfully launches my application from the terminal

This is my application-x-demo.xml file enter image description here I have tried logging out and in again, but it still does not work.

I have tried these links, but they don't work for me. https://bbs.archlinux.org/viewtopic.php?id=192204 Unity launcher won't update the shortcuts after update-desktop-database (only after log out)

Vipul Gupta avatar
al flag
@Nmath I have edited the question, can u check now.
Nmath avatar
ng flag
Can you also add the `.xml` file you created in `/usr/share/mime/packages`? For the commands that your instructions advise to run as root, are you using sudo?
Vipul Gupta avatar
al flag
yes, I m using sudo. I have added the .xml file
Nmath avatar
ng flag
Hmmm.. Maybe there's a permissions issue? The .xml and .desktop files should probably have 644 permissions. You might also try putting the script somewhere other than a user's home folder. And also make sure that the script is executable.
Vipul Gupta avatar
al flag
I updated the ~/.local/share/applications(I guess it had some unupdated changes) with sudo and now I am able to update the desktop database under /usr/share/applications. But the file association is not working. The command "gio mime application/x-demo" gives me the correct registered application(my application) but If I run the command "gio info myFile.axsd | grep "standard::content-type"", it gives me the content type as text/plain and not application/x-demo. Any help here?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.