I can't change default applications

Ubuntu Version:
24.04.3 LTS

Desktop Environment (if applicable):
GNOME

Problem Description:
When I want to select a default app, Ubuntu ignores it. I usually open a file and choose the program I want by pressing “open with…”. This always worked, but not in this installation.

I went to the settings menu, and when I go to “default apps,” the selected apps appear, but it won’t let me change them. It’s as if there were no options (which there are).

I looked up how to do it via terminal, and saw that I had to modify the file ~/.local/share/application/mimetypes.list, but it doesn’t exist.

Is there a way to recreate that file? I don’t want to reinstall all of Ubuntu; I installed it yesterday. I didn’t change anything unusual.

Thanks.

Relevant System Information:
I only downloaded Gnome extensions and verified applications.

Screenshots or Error Messages:
1. I try to open the files this way and select the applications I want as defaults. It doesn’t work.

  1. I cannot select any default application. The ones that are there are automatically chosen by the system.

  1. I try to access that route, but it does not exist.

What I’ve Tried:
I tried to find other people with the same problem, but I couldn’t find this error as such. It’s as if this file hadn’t been installed.

I think you’re barking up the wrong tree … directory tree, that is. The file storing associations between MIME-types and applications is ~/config/mimeapps.list. I’ve also got a ~/.local/share/applications/mimeapps.list, but the only program that has associations in there is Softmaker Free Office (which I tried a while back only to stay on Libre Office), so I think that might be a mistake (by Softmaker).
The format of that file is quite simple. It’s a plain text file. There are two sections introduced by lines saying ‘[Added Association]’ and ‘[Default Applications]’. Every normal line begins with one file type, an ‘=’-sign, and a ‘;’-separated list of desktop files for programs associated with that file type, e.g.:

[Added Association]
text/plain=emacs25.desktop;vim.desktop
.
.
.

[Default Applications]
text/plain=org.xfce.mousepad.desktop
.
.
.

For further details, see https://specifications.freedesktop.org/mime-apps/latest/

2 Likes

Yes, sorry, I was reading an article about someone who had a problem with Free Office.

I have the directory, but it’s completely empty. Does it need to have a file inside? What is the file called? Do I need to use a special program to do this?

I’m seriously considering reinstalling it. I’m afraid this can’t be fixed.

(By the way, there is a file called mimeapps.list.new. Could it have something to do with the problem?)

mimeapps.list should not be a directory – it should be a plain text file. Check whether the file ‘mimeapps.list.new’ actually is a valid mimeapps.list. If it is, remove that directory and rename the file.

1 Like

It worked!!! It’s accepting applications by default again!!!

The Ubuntu menu is not displaying correctly; it is still frozen. However, if you attempt to open a file with “open as…,” it works.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.