Updates messing up with mime types

Hi. I’m having a very weird issue recently, which I don’t know exactly what the cause is: after every system update my mime types get completely messed up and I have to manually set then via command line. I don’t if it’s some weird interaction with Gnome or else. I noticed that pacman regenerates the mime database during an upgrade, but I don’t remember having any trouble with this in the past. So, what could it be?

Which mime types are going wrong and how did you set on command line?

Maybe this topic could help you.

1 Like

I am not experiencing this issue under GNOME.

This might be the probable cause but at this point I don’t know what it might be.

Interesting issue. I’ll be following your topic to see when you hopefully will find the cause and the solution.

VSCode hijacking the action of opening folders from Nautilus is common for me, but the issue started to get more serious when suddenly the system “forgets” that Evince opens .pdf files and EOG opens all kinds of image extensions, falling back to ImageMagick for both and I can’t even chose the right application under “Open With” since I get no other option. I believe this happened to video formats as well one time. This always happens after a system upgrade.

What I did to fix VSCode with folders and what I did with the other cases was using commands like

xdg-mime default org.Gnome.Evince.desktop pdf

for example, just like the post you commented said.

I guess it is a Gnome issue. Here is an example.

This is really strange. Maybe because Gnome is using dbus and not pure files for reading/saving configuration :thinking: .

Normally (unless there is an ugly bug), package updates do not write inside user’s folder.
Under an active user session, the whichever DE/FM will change mime-related files (similarly to what your command does), when requested or as designed.

For troubleshooting this, I would save local and system mime files (cache and ~/.config/*mimeapps.list) in a debug folder, and after this happens again (after an update?), I would check for differences. :person_shrugging:

1 Like

Did another system update now with your suggestion. Nothing changed, apparently… Hm. Gonna keep the mimeapps list to see when something weird happens, if it happens again. Last time I had to manually intervene was yesterday.

1 Like

As an update: it happened again, with video, photo and document formats forgetting about their default applications and even more, forgetting at all about any other application on the system that could open them. The mimeapps.list wasn’t altered, of course, I would be very surprised (and worried) if it did… So this time I tried the good old logout and log back again, and it’s fine.

What? haha

I guess this might be a weird bug with Gnome/Gnome apps, I don’t know. Probably has nothing to do with updates except that I only notice the issue after an update.

I automatically reboot after all updates I perform. It only takes about 30 seconds or a little more, and it can occasionally save quite a bit of time troubleshooting a problem only to have it go away after a reboot. For a personal home computer this is easy to do. In a Corporate environment, maybe not so much.

Why did I start doing this. Off and on, I tinkered with Fedora for my Linux machine. Here is a quote from Fedora Magazine

Offline Updates

The process of restarting, applying updates, and then restarting
again is called Offline Updates. Your computer boots into a
special save-mode, where all other systems are disabled and
where network access is unavailable. It then applies the updates
and restarts. 

This worked so well, after a stint of using Fedora, I started doing a reboot after all updates in Archlinux. I can’t duplicate what Fedora does, so I settle for a reboot. IMHO it has served me well.



I do that as well, since I don’t usually update every single day, so whenever I do an update (roughly every friday) I have a kernel or other important package to update. So I reboot, naturally. But since I also mostly keep my computer on and only suspend during week days, I tend to only notice issues after the usual friday update + reboot action. Mistaking it with updates was probably a case of “post hoc, ergo propter hoc” on my side.

Try man pkcon (if packagekit is installed).
From this:

pkcon refresh
pkcon get-updates
pkcon update --only-download
pkcon offline-trigger

Use at your own risk. :zipper_mouth_face:

1 Like