Fix for “There is no application installed for … files. Do you want to search for an application to open this file?” on modern Ubuntu MATE

Previous Ubuntu MATE versions like 18.04 LTS (and older) allow user to automatically find and install software to allow manipulation with unknown file-types.

But in modern Ubuntu 20.04 LTS (and newer) the above mechanism is broken.

Example is for DXF-file below: one opens 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 then one clicks 'Yes' in this window – nothing happens.

To revert the previous behavior one needs to follow one of the below methods.
They differ by actual org.freedesktop.PackageKit dbus service provider.

Legacy method using sessioninstaller

Install single package from my special PPA which provides needed functionality:

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

and then click on unknown file again and proceed with software installation as shown in screencast below:

dxf

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:

and then finally open DXF file.