Is it possible to install and use Flatpak as a non-root user?

Parke parke.nexus at gmail.com
Sun Feb 2 02:29:17 UTC 2020


Thank you for the information about the (undocumented?) --user flag.

As a non-root user on an Ubuntu 19.10 host, I downloaded and extracted
an Alpine Linux "mini root filesystem".  Alpine says this filesystem
is "for use in containers and minimal chroots."

I used a utility I wrote (https://github.com/parke/lxroot) to
unshare() and chroot() into the directory that contained the extracted
Alpine Linux filesystem.  (At this point, I am running an Alpine Linux
userland inside a transient Linux user namespace that was dynamically
created by lxroot, all on top of the Ubuntu 19.10 kernel.)

I ran:  apk add flatpak

apk reported two incidental(?) errors:
ERROR: Failed to set ownership on
sbin/.apk.184608d476783efa68496465c9d88b3a94879eaeba553671: Invalid
argument
ERROR: Failed to set ownership on
etc/polkit-1/rules.d/.apk.5d6fc4ed50a34374ccfa65d236e32f5448a5b9627be05aec:
Invalid argument

(I believe the user namespace forbids ownership changes.)

I successfully ran:  flatpak --user  remote-add --if-not-exists
flathub https://flathub.org/repo/flathub.flatpakrepo

I ran:  flatpak --user install flathub org.gnucash.GnuCash

ID  Arch  Branch  Remote  Download
 1. [check] org.gnome.Platform  x86_64  3.34
 2. [check] org.gnome.Platform.Locale  x86_64  3.34
 3. [check] org.freedesktop.Platform.GL.default  x86_64  19.08
 4. [x] org.freedesktop.Platform.openh264  x86_64  19.08
 5. [check] org.gnucash.GnuCash  x86_64  stable
 6. [check] org.gnucash.GnuCash.Locale  x86_64  stable

Warning: org.freedesktop.Platform.openh264 not installed
Installation complete.

flatpak did not provide an explanation as to why openh264 was not installed.

Now, when I try to run GnuCash, I get the following error(s):

$ flatpak --user run org.gnucash.GnuCash
ldconfig: /app/lib/libguile-2.2.so.1.3.0-gdb.scm is not an ELF file -
it has the wrong magic bytes at the start.

error: Invalid group: 1002

$ id
uid=1002 gid=1002 groups=1002,65534(nobody)

Summary:  I have not yet found a way to install and run Flatpak
packages as a non-root user.

I may not investigate further, as I have found an alternative,
non-Flatpak method of installing and running GnuCash as a non-root
user.

Thank you for your assistance.

Best,

Parke


More information about the Flatpak mailing list