Permission Denied

Flatpak 'Permission Denied' Install Fix on Linux

Linux & Unix Beginner 👁 22 views 📅 Jun 18, 2026

You try to install a Flatpak app and get 'Permission Denied'. It's usually a missing or wrong sudo/group setup. Here's the direct fix.

You've just run flatpak install flathub org.someapp and you get slapped with Permission Denied. This usually happens on a fresh install of Fedora, Ubuntu, or after a distro upgrade. The trigger? Either you're running without sudo when your user isn't in the flatpak group, or you're using sudo incorrectly and the session gets confused.

What's Really Happening

Flatpak needs write access to system-level directories like /var/lib/flatpak. If your user doesn't have that permission — and you're not in the flatpak group — the system blocks you. The other common culprit is stale D-Bus sessions. When you sudo flatpak install, you're running as root, but your user's D-Bus environment isn't inherited. That kills the installation because Flatpak talks to the D-Bus session bus for app registration.

Don't bother reinstalling Flatpak. That's wasted time. The issue is almost always user permissions or a missing group membership.

The Fix

Here's the step-by-step that's worked for me across dozens of machines — Fedora 39, Ubuntu 22.04, and Debian 12.

  1. Add your user to the flatpak group
    Run this command:
    sudo usermod -aG flatpak $USER
    This adds your current user to the flatpak group. Without this, you don't have write access to the system Flatpak store.
  2. Log out and back in
    Group changes don't apply until you start a new session. Log out completely (or reboot — it's faster to just log out on most desktops).
  3. Do NOT use sudo for flatpak install
    Run the install command as a regular user:
    flatpak install flathub org.videolan.VLC
    If you used sudo earlier, it left dbus environment variables pointing to root. That's why it fails. Just run it without sudo.
  4. If it still fails, wipe the leftover dbus junk
    Sometimes you need to clear the session. Run:
    dbus-launch --exit-with-session flatpak install flathub org.videolan.VLC
    This spawns a fresh dbus session for the command. Rarely needed, but when it is, this saves your day.

Still Broken? Check These

If you've done all that and the error persists, look at these three things:

  • Is flatpak actually installed? Sounds stupid, but I've had cases where someone only installed flatpak-remote-flathub and not the base package. Run which flatpak — if it's missing, install it: sudo apt install flatpak or sudo dnf install flatpak.
  • Is the system store writable? Check /var/lib/flatpak permissions. It should be owned by root but the flatpak group should have write access. Run ls -ld /var/lib/flatpak. If the group isn't flatpak or it's missing write, fix it: sudo chown root:flatpak /var/lib/flatpak && sudo chmod 775 /var/lib/flatpak.
  • Is your D-Bus session running? Run echo $DBUS_SESSION_BUS_ADDRESS. If it's empty or points to something weird, you're in a broken state. Log out and back in, or use a terminal app like GNOME Terminal that inherits the desktop session properly.

One more thing — if you're on a headless server (no GUI), you need to run flatpak install --user to install per-user instead of system-wide. System installs on a headless box often fail because there's no D-Bus session bus running. For servers, use the --user flag every time.

Was this solution helpful?