Flatpak-spawn disappears after zorin 18.1 update

Hi guys,

I just updated Zorin OS from 17.3 to 18.1, and now flatpak-spawn completely disappeared from my Dolphin File Manager (Flatpak version).

I use Dolphin to run custom shell scripts for my daily workflow, and they all depend on flatpak-spawn. Now none of them work.

Anyone knows how to fix this? I really don't want to distro-hop or format my PC because of this.

Thanks!

I gave all the necessary permissions with flatseal:

Given a direct upgrade was performed, it is reasonable that some packages may miss the install candidate mark.
I would open a terminal and run:
Reinstall the software to make sure all is well:

sudo apt install --reinstall flatpak xdg-desktop-portal xdg-desktop-portal-gtk

Repair any components:

flatpak repair

Ensure Dolphin (and all other flatpaks) are up to date:

flatpak update

Once that is done, test...

1 Like

No Luck, it's still not finding flatpak-spawn

I created this script to check if it exists:

#!/bin/sh
LOG_DATA="/home/renanz/temp/test-write/diag_shell.txt"

echo "=== DIAGNOSTIC ENVIRONMENT ===" > "$LOG_DATA"

echo "Shell enabled (via ps):" >> "$LOG_DATA"
ps -p $$ -o comm= >> "$LOG_DATA"

echo "Variable \$SHELL: $SHELL" >> "$LOG_DATA"

echo "Directories in \$PATH container:" >> "$LOG_DATA"
echo "$PATH" >> "$LOG_DATA"

echo "Where is flatpak-spawn?" >> "$LOG_DATA"
command -v flatpak-spawn >> "$LOG_DATA" 2>&1

The output:

=== DIAGNOSTIC ENVIRONMENT ===
Shell enabled (via ps):
shell-diag.sh
Variable $SHELL: /bin/sh
Directories in $PATH container:
/app/bin:/usr/bin
Where is flatpak-spawn?

the command -v is an empty line

The script would show only within constraints of within the container, not if Flatpak-spawn itself is actually present.
In terminal you can check:

which flatpak-spawn

If present:

flatpak-spawn --version

If we establish it is present - which it should be, as part of Flatpak, the the next step is to check if Flatpak Dolphin is properly supporting it.

Did You checked that Dolphin is still installed as Flatpak?

When this is the actual Package Name, I searched for it but only got this:

I looked at pkgs.org for the Package but it didn't found it for a Debain/Ubuntu-based Distro at all:
https://pkgs.org/search/?q=flatpak-spawn

I'm receiving a "command not found" error, but only when I try to run it inside Dolphin's built-in terminal panel (Konsole).

If i run in terminal, looks like it works, but i don't know actually:

 flatpak run --command="sh" org.kde.dolphin
[📦 org.kde.dolphin ~]$ flatpak-spawn --version
flatpak-spawn: Opção --version desconhecida
Try "flatpak-spawn --help" for more information.
[📦 org.kde.dolphin ~]$ flatpak-spawn --help
Uso:
  flatpak-spawn [OPÇÃO…] COMMAND [ARGUMENT…]

Run a command in a sandbox

Opções de ajuda:
  -h, --help                            Mostra opções de ajuda

Opções de aplicativo:
  -v, --verbose                         Enable debug output
  --forward-fd=FD                       Forward file descriptor
  --clear-env                           Run with clean environment
  --watch-bus                           Make the spawned command exit if we do
  --expose-pids                         Expose sandbox pid in calling sandbox
  --share-pids                          Use same pid namespace as calling sandbox
  --env=VAR=VALUE                       Set environment variable
  --unset-env=VAR=VALUE                 Unset environment variable
  --env-fd=FD                           Read environment variables in env -0 format from FD
  --latest-version                      Run latest version
  --sandbox                             Run sandboxed
  --no-network                          Run without network access
  --sandbox-expose=NAME                 Expose access to named file
  --sandbox-expose-ro=NAME              Expose readonly access to named file
  --sandbox-expose-path=PATH            Expose access to path
  --sandbox-expose-path-ro=PATH         Expose readonly access to path
  --sandbox-expose-path-try=PATH        Expose access to path if it exists
  --sandbox-expose-path-ro-try=PATH     Expose readonly access to path if it exists
  --sandbox-flag=FLAG                   Enable sandbox flag
  --sandbox-a11y-own-name=DBUS_NAME     Allow owning the name on the a11y bus
  --host                                Start the command on the host
  --directory=DIR                       Working directory in which to run the command
  --app-path=DIR|""                     Replace runtime's /app with DIR or empty
  --usr-path=DIR                        Replace runtime's /usr with DIR
[📦 org.kde.dolphin ~]$ which flatpak-spawn
/usr/bin/flatpak-spawn

Yes, i checked:

     ﲅ  flatpak list | grep org.kde.dolphin
Dolphin	org.kde.dolphin	26.04.2	stable	flathub	system

I typed the same command, it says here it's installed, its really the right package?

     ﲅ  apt search flatpak-spawn
Ordenando... Pronto
Pesquisa de texto completo... Pronto
flatpak-xdg-utils/noble,now 1.0.5-3build2 amd64 [instalado]
  xdg-open and xdg-email reimplementation for containerized apps

Maybe try it with the non-Flatpak Version of Dolphin? You would avoid this Way the Permission Thing.

The main issue is that the apt version in Zorin OS is pretty outdated. I actually tried switching to the native APT package before, but I had to go back to the Flatpak because it's the only way to get the latest features.

And do You need the latest Features for that? If not, it wouldn't matter.

Yes i need

We see that flatpak-spawn is installed and present.

It is working when you are launching it in a shell:
flatpak run --command=sh org.kde.dolphin

You are getting a "command not found" when run from the Konsole within Dolphin - this makes me suspect the path in the scripting you are using.
Not Dolphin and not Flatpak, but instead, the embedded konsole terminal environment.
Have there been any changes to this or custom scripts?

No, there are no changes. In Zorin OS 17.3, these scripts work without any issues in the embedded Konsole environment

In the embedded konsole in Dolphin, what output do you get for

type flatpak-spawn

which flatpak-spawn

echo "$PATH"

Here:

 renanz-STORM-TWO   sábado  junho 06  08:30 
 ▲     /home/renanz
▲ ▲    ~
     ﲅ  type flatpak-spawn
flatpak-spawn not found
 renanz-STORM-TWO   sábado  junho 06  08:30 
 ▲     /home/renanz
▲ ▲    ~
     ﲅ  which flatpak-spawn
flatpak-spawn not found
 renanz-STORM-TWO   sábado  junho 06  08:30 
 ▲     /home/renanz
▲ ▲    ~
     ﲅ  echo "$PATH"
/home/renanz/.luarocks/bin:/home/renanz/.nvm/versions/node/v20.19.4/bin:/home/renanz/.local/share/pnpm:/home/renanz/.local/bin:/home/renanz/scripts/exec:/usr/local/openresty/bin:/usr/local/openresty/nginx/sbin:/home/renanz/.local/lua/5_4_8/bin:/home/renanz/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

I think you need to switch your Konsole font, to... perhaps to MesloGS? It is currently showing a lot of missing characters.

What we see here is that the Konsole in Dolphin and your system are not both running in the same environment.
It looks like Dolphin (whith Konsole) are further isolated as Flatpaks, running in their own sandbox.
It is calling on the system: /usr/bin/flatpak-spawn which it is isolated from.

Honestly: The best and most practical fix is to remove the flatpak package of Dolphin (With Konsole) and install them from the terminal as .deb packages.

The other option, if you are keen on keeping them as Flatpak - is to use Flatseal to broaden Dolphin's permissions.

As to why this changed on the upgrade to 18 - most likely due to tighter restrictions between versions.