How to correctly proceed with "There is no application installed for ... files. Do you want to search for an application to open this file?" on MATE?

I have Ubuntu MATE 20.04 LTS installed. I have downloaded DXF file which is not known for my operating system.

I open Caja, navigate to this file, try to open it. And then get the following message:

Could not display "/home/user/file.dxf"

There is no application installed for DXF vector image files. Do you want to search for an application to open this file?

and I clicked 'Yes' in this window. But nothing happened.

I remember from my previous Ubuntu MATE 18.04 LTS that it should open smaller software installation window, then ask me a password and finally install the software.

What is wrong?


Solution 1:

With some debugging using dbus-monitor I see the following on pressing Yes button:

$ dbus-monitor
...
method call time=1627826047.524366 sender=:1.27 -> destination=org.freedesktop.PackageKit serial=373 path=/org/freedesktop/PackageKit; interface=org.freedesktop.PackageKit.Modify; member=InstallMimeTypes
   uint32 14680581
   array [
      string "image/vnd.dxf"
   ]
   string "hide-confirm-search"
error time=1627826047.524401 sender=org.freedesktop.DBus -> destination=:1.27 error_name=org.freedesktop.DBus.Error.ServiceUnknown reply_serial=373
   string "The name org.freedesktop.PackageKit was not provided by any .service files"
method call time=1627826047.524930 sender=:1.27 -> destination=org.freedesktop.DBus serial=374 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string 
...

So we need to get some org.freedesktop.PackageKit dbus service provider.

Legacy method using sessioninstaller

Previous Ubuntu versions was using the sessioninstaller. But after some time this package was removed from Ubuntu after 18.04 LTS.
I have reported a bug 1938641 to LaunchPad.
The sessioninstaller package depends on app-install-data package which is outdated (last upgrade was in 2015 year), so does not contain information of modern applications.

But if one still wants to restore the previous (Ubuntu MATE 18.04 LTS) behavior - one should install the sessioninstaller from my PPA:

sudo add-apt-repository ppa:nrbrtx/sessioninstaller
sudo apt-get update
sudo apt-get install sessioninstaller

and then proceed as it was planned:

Application for DXF is now found

Modern method

There are two other org.freedesktop.PackageKit dbus service providers - Apper and GNOME Software. Both use AppStream as a provider of package information. But the development of Apper seems to be stalled.

So even on Ubuntu MATE one should use GNOME Software. To install and initialize it one needs to remove sessioninstaller by

sudo apt-get install ppa-purge
sudo ppa-purge ppa:nrbrtx/sessioninstaller

and then run:

sudo apt-get install packagekit gnome-software
sudo apt-get update

and then use it to install software - click on DXF file again and then follow notifications on screen to get GNOME Software opened:

GNOME Software suggests applications to open DXF

and then finally open DXF file.