Flatpak apps not working on Ubuntu 24.04 with Encrypted Home Directory
https://askubuntu.com/questions/1563228/flatpak-apps-not-working-on-ubuntu-24-04-with-encrypted-home-directory
Flatpak apps do not seem to be working properly on my Ubuntu 24.04 system.
I encrypted my Home directory using ecryptfs.
I installed flatpak from ubuntu's official repositories via sudo apt install flatpak, and followed all the setup steps described in flathub's guide for ubuntu (link: https://flathub.org/en/setup/Ubuntu). This installs flatpak version 1.14.6-1ubuntu0.1 .
I then proceeded to install flatpak apps from flathub's repository.
I am especially interested in the Pika Backup app, so I will focus on that. I tested a couple of other flatpak apps from flathub (such as Deja Dup and a game app called "muttum" just for the purpose of testing) and they display a similar behaviour, so it seems like a general problem with flatpak on ubuntu, at least on my system.
I installed the Pika Backup app via the command line with the command flatpak install flathub org.gnome.World.PikaBackup, as described in the flathub website (link: https://flathub.org/en/apps/org.gnome.World.PikaBackup).
However, the app does not launch either from Ubuntu's apps menu or from the command line (via the command flatpak run org.gnome.World.PikaBackup). The command displays the following error message:
error: mkdir(/home/uat/.var): Permission denied
When running the same command with the verbose option it gives the following output:
flatpak -v run org.gnome.World.PikaBackup
F: No installations directory in /etc/flatpak/installations.d. Skipping
F: Opening system flatpak installation at path /var/lib/flatpak
F: Opening user flatpak installation at path /home/uat/.local/share/flatpak
F: Opening user flatpak installation at path /home/uat/.local/share/flatpak
F: Opening system flatpak installation at path /var/lib/flatpak
F: Skipping parental controls check for app/org.gnome.World.PikaBackup/x86_64/stable since parental controls are disabled globally
F: Opening user flatpak installation at path /home/uat/.local/share/flatpak
F: Opening system flatpak installation at path /var/lib/flatpak
error: mkdir(/home/uat/.var): Permission denied
Trying the command with sudo: sudo flatpak run org.gnome.World.PikaBackup as a work-around gives the following output:
error: "flatpak run" is not intended to be run as `sudo flatpak run`.
Use `sudo -i` or `su -l` instead and invoke "flatpak run"
from inside the new shell.
I tried to run the program with sudo -i, followed by the same command flatpak run org.gnome.World.PikaBackup (even though I think it should have worked without sudo permissions, but for the purpose of troubleshooting I follow along). This way the app's graphical interface is launched, however it seems to not be working properly yet. For instance, when I try to select a folder for a new backup repository it opens a dialog box with the following message and does not proceed:
The session bus is not available
Does anyone have experience with working with flatpak apps on Ubuntu? If so, did you setup it differently from what is described in flathub's guide (https://flathub.org/en/setup/Ubuntu)? And do you need sudo permissions to run flatpak apps?
Some apps are only available as flatpaks, so it would be an important addition to my Ubuntu system. Otherwise, I might have to look into other alternative Linux operating systems which support flatpaks.
Thanks in advance!
Additional Info
namei -l ~/.var output:
f: /home/uat/.var~
drwxr-xr-x root root /
drwxr-xr-x root root home
dr-x------ uat uat uat
.var~ - No such file or directory
findmnt -T ~/ output:
TARGET SOURCE FSTYPE OPTIONS
/home/uat
/home/uat/.Private
ecrypt rw,nosuid,nodev,relatime,ecryptfs_fnek_sig=...
grep -r flatpak /etc/apparmor.d/ output:
/etc/apparmor.d/flatpak:profile flatpak /usr/bin/flatpak flags=(unconfined) {
/etc/apparmor.d/flatpak: include if exists <local/flatpak>
/etc/apparmor.d/usr.bin.evince: owner @{HOME}/.local/share/{,flatpak/exports/share/}mime/** r,
/etc/apparmor.d/usr.bin.evince: owner @{HOME}/.local/share/{,flatpak/exports/share/}mime/** r,
/etc/apparmor.d/tunables/share:@{flatpak_exports_root} = {flatpak/exports,flatpak/{app,runtime}/*/*/*/*/export}
/etc/apparmor.d/tunables/share:@{system_share_dirs} = /{usr,usr/local,var/lib/@{flatpak_exports_root}}/share
/etc/apparmor.d/tunables/share:@{user_share_dirs} = @{HOME}/.local{,/share/@{flatpak_exports_root}}/share