xdg-desktop-portals-gtk broken in ubuntu 20.04, and how to fix it.

The Problem:

some programs take an extraordinary long time to start.

If you take a look at the error messages:

$ systemctl --user status xdg-desktop-portal-gtk.service ● xdg-desktop-portal-gtk.service - Portal service (GTK+/GNOME implementation) Loaded: loaded (/usr/local/lib/systemd/user/xdg-desktop-portal-gtk.service; static; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2020-05-13 23:46:05 CEST; 11min ago Process: 6937 ExecStart=/usr/local/libexec/xdg-desktop-portal-gtk (code=exited, status=127) Main PID: 6937 (code=exited, status=127) maj 13 23:46:05 octo systemd[2171]: Starting Portal service (GTK+/GNOME implementation)... maj 13 23:46:05 octo xdg-desktop-portal-gtk[6937]: /usr/local/libexec/xdg-desktop-portal-gtk: error while loading shared libraries: libgnome-desktop-3.so.18: cannot open shared object file:> maj 13 23:46:05 octo systemd[2171]: xdg-desktop-portal-gtk.service: Main process exited, code=exited, status=127/n/a maj 13 23:46:05 octo systemd[2171]: xdg-desktop-portal-gtk.service: Failed with result 'exit-code'. maj 13 23:46:05 octo systemd[2171]: Failed to start Portal service (GTK+/GNOME implementation). ...skipping... ● xdg-desktop-portal-gtk.service - Portal service (GTK+/GNOME implementation) Loaded: loaded (/usr/local/lib/systemd/user/xdg-desktop-portal-gtk.service; static; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2020-05-13 23:46:05 CEST; 11min ago Process: 6937 ExecStart=/usr/local/libexec/xdg-desktop-portal-gtk (code=exited, status=127) Main PID: 6937 (code=exited, status=127) maj 13 23:46:05 octo systemd[2171]: Starting Portal service (GTK+/GNOME implementation)... maj 13 23:46:05 octo xdg-desktop-portal-gtk[6937]: /usr/local/libexec/xdg-desktop-portal-gtk: error while loading shared libraries: libgnome-desktop-3.so.18: cannot open shared object file:> maj 13 23:46:05 octo systemd[2171]: xdg-desktop-portal-gtk.service: Main process exited, code=exited, status=127/n/a maj 13 23:46:05 octo systemd[2171]: xdg-desktop-portal-gtk.service: Failed with result 'exit-code'. maj 13 23:46:05 octo systemd[2171]: Failed to start Portal service (GTK+/GNOME implementation). 

you will see that the problem is that libgnome-3.so.18 is missing, and it is not shipped with 20.04, and can not be installed.

The fix:

We just sym-link it…

$ cd /usr/lib/x86_64-linux-gnu $ sudo ln -s libgnome-desktop-3.so libgnome-desktop-3.so.18 

Now the service can start. It seems to be a dependency issue.