FLATPAK-OVERRIDE(1)

πŸ’– FLATPAK-OVERRIDE πŸ’–

okay bestie, pull up a chair πŸͺ‘ because we're talking about flatpak-override β€” that's section 1 of the manual, the main character of the flatpak override saga πŸ‘‘


✨ NAME ✨

flatpak-override β€” Override application requirements πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

flatpak override [OPTION...] [APP]

🌸 DESCRIPTION 🌸

so basically? it overrides the application's specified runtime requirements. πŸ’… Which is the fancy way of saying: this is how you hand a sandboxed app more or less stuff than it asked for. Give it the goods, or take the goods away. Your call, your rules, your sandbox πŸ–οΈ

By default, the app gets access to the resources it requested when it's started. That's the "trust the app, it knows what it wants" default. But you β€” yes you, the icon you are πŸ‘‘ β€” can override that:

  • On a particular instance β€” by passing extra arguments to flatpak run. One-off vibe, just for that run.
  • Every single time β€” by using flatpak override. Permanent, set-it-and-forget-it energy ✨

The application overrides get saved in text files that live in $XDG_DATA_HOME/flatpak/overrides in user mode πŸ“ (yes, literally text files, you can go look at them, they're not hiding anything, we love transparency πŸ’–).

If the application ID APP is not specified, then the overrides affect all applications 🌈 β€” global queen behaviour. But (plot twist 🫒) the per-application overrides can override the global overrides. So the specific app always wins the argument. Periodt πŸ’…

⚠️ Heads up bestie: unless you override it with the --user or --installation options, this command changes the default system-wide installation. So like, it's not just you β€” it's everybody. Act accordingly 😭

more coming, don't go anywhere 🫢

✨ OPTIONS ✨

okay so here's the whole menu of things you can pass. all of these are understood by the command, bestie πŸ’–

  • -h, --help β€” shows you the help options and dips. that's it, that's the whole job 🫢
  • -u, --user β€” updates a per-user installation. your own little corner of the world, just for you πŸ’œ
  • --system β€” updates the default system-wide installation. the big shared one, everybody's business 🌈
  • --installation=NAME β€” updates a system-wide installation, picked by NAME, from the ones defined in /etc/flatpak/installations.d/. and heads up: using --installation=default is literally the same thing as using --system, no cap πŸ‘‘
  • --share=SUBSYSTEM β€” shares a subsystem with the host session. this overrides the Context section from the application metadata. SUBSYSTEM has to be one of: network, ipc. you can use this option multiple times, stack 'em up ✨
  • --unshare=SUBSYSTEM β€” the opposite vibe: does NOT share a subsystem with the host session. this overrides the Context section from the application metadata. SUBSYSTEM must be one of: network, ipc. also usable multiple times πŸ’…
  • --share-if=SUBSYSTEM:CONDITION β€” shares a subsystem with the host session conditionally, only when the specified condition is actually met at runtime. this overrides the Context section from the application metadata. SUBSYSTEM must be one of: network, ipc. CONDITION must be one of: true, false, has-input-device, has-wayland, has-usb-device, has-usb-portal. conditions can be negated with !, like !has-input-device. multiple uses allowed. available since 1.17 πŸ¦‹

see the Conditional Permissions section in flatpak-metadata(5) for the whole tea.

  • --socket=SOCKET β€” exposes a well-known socket to the application. this overrides the Context section from the application metadata. SOCKET must be one of: x11, wayland, fallback-x11, pulseaudio, system-bus, session-bus, ssh-auth, pcsc, cups, gpg-agent, inherit-wayland-socket. multiple uses, go wild πŸŽ€
  • --nosocket=SOCKET β€” does NOT expose a well-known socket to the application. this overrides the Context section from the application metadata. SOCKET must be one of: x11, wayland, fallback-x11, pulseaudio, system-bus, session-bus, ssh-auth, pcsc, cups, gpg-agent, inherit-wayland-socket. multiple uses allowed πŸ’–
  • --socket-if=SOCKET:CONDITION β€” exposes a well-known socket to the application conditionally, only when the specified condition is met at runtime. this overrides the Context section from the application metadata. SOCKET must be one of: x11, wayland, fallback-x11, pulseaudio, system-bus, session-bus, ssh-auth, pcsc, cups, gpg-agent, inherit-wayland-socket. CONDITION must be one of: true, false, has-input-device, has-wayland, has-usb-device, has-usb-portal. conditions can be negated with !, like !has-wayland. multiple uses allowed. available since 1.17 ⭐

see the Conditional Permissions section in flatpak-metadata(5) for more details.

  • --device=DEVICE β€” exposes a device to the application. this overrides the Context section from the application metadata. DEVICE must be one of: dri, input, usb, kvm, shm, all. multiple uses, bestie πŸ”₯
  • --nodevice=DEVICE β€” does NOT expose a device to the application. this overrides the Context section from the application metadata. DEVICE must be one of: dri, input, usb, kvm, shm, all. multiple uses πŸ’…
  • --device-if=DEVICE:CONDITION β€” exposes a device to the application conditionally, only when the specified condition is met at runtime. this overrides the Context section from the application metadata. DEVICE must be one of: dri, input, usb, kvm, shm, all. CONDITION must be one of: true, false, has-input-device, has-wayland, has-usb-device, has-usb-portal. conditions can be negated with !, like !has-input-device. multiple uses allowed. available since 1.17 🌸

see the Conditional Permissions section in flatpak-metadata(5) for more details.

  • --allow=FEATURE β€” allows access to a specific feature. this updates the [Context] group in the metadata. FEATURE must be one of: devel, multiarch, bluetooth, canbus, per-app-dev-shm. multiple uses allowed 🧚

see flatpak-build-finish(1) for what all these features actually mean.

  • --disallow=FEATURE β€” disallows access to a specific feature. this updates the [Context] group in the metadata. FEATURE must be one of: devel, multiarch, bluetooth, canbus, per-app-dev-shm. multiple uses allowed πŸ’œ
  • --allow-if=FEATURE:CONDITION β€” allows access to a specific feature conditionally, only when the specified condition is met at runtime. this overrides the Context section from the application metadata. FEATURE must be one of: devel, multiarch, bluetooth. CONDITION must be one of: true, false, has-input-device, has-wayland, has-usb-device, has-usb-portal. conditions can be negated with !, like !has-input-device. multiple uses allowed. available since 1.17 ✨

see the Conditional Permissions section in flatpak-metadata(5) for more details.

  • --filesystem=FILESYSTEM β€” lets the application access a subset of the filesystem. this overrides the Context section from the application metadata. FILESYSTEM can be one of: home, host, host-os, host-etc, host-root, xdg-desktop, xdg-documents, xdg-download, xdg-music, xdg-pictures, xdg-public-share, xdg-templates, xdg-videos, xdg-run, xdg-config, xdg-cache, xdg-data, an absolute path, or a homedir-relative path like ~/dir or paths relative to the xdg dirs, like xdg-download/subdir. the optional :ro suffix means the location is read-only. the optional :create suffix means the location is read-write AND gets created if it doesn't already exist. multiple uses allowed. check the "[Context] filesystems" list in flatpak-metadata(5) for what all these filesystems actually mean πŸ‘‘
  • --nofilesystem=FILESYSTEM β€” undoes the effect of a previous --filesystem=FILESYSTEM from the app's manifest or a lower-precedence layer of overrides, and/or removes a previous --filesystem=FILESYSTEM from this layer of overrides. this overrides the Context section of the application metadata. FILESYSTEM takes the same values as for --filesystem, but the :ro and :create suffixes are not used here. multiple uses allowed πŸ’–
lowkey important: this option does NOT block access to a more narrowly-scoped --filesystem. for example, if an application has the equivalent of --filesystem=xdg-config/MyApp in its manifest or as a system-wide override, and you do flatpak override --user --nofilesystem=home as a per-user override, then it gets blocked from most of the home directory, but it's still allowed to access $XDG_CONFIG_HOME/MyApp. sneaky, right? 😭

and as a special case: --nofilesystem=host:reset ignores ALL --filesystem permissions inherited from the app manifest or a lower-precedence layer of overrides, on top of doing the --nofilesystem=host thing. full reset energy πŸ’€

  • --add-policy=SUBSYSTEM.KEY=VALUE β€” adds a generic policy option. for example, "--add-policy=subsystem.key=v1 --add-policy=subsystem.key=v2" would map to this metadata:
[Policy subsystem]
key=v1;v2;

this option can be used multiple times 🌈

  • --remove-policy=SUBSYSTEM.KEY=VALUE β€” removes a generic policy option. this option can be used multiple times πŸ¦‹
  • --env=VAR=VALUE β€” sets an environment variable in the application. this overrides the Context section from the application metadata. this option can be used multiple times ✨
  • --unset-env=VAR β€” unsets an environment variable in the application. this overrides the unset-environment entry in the [Context] group of the metadata, and the [Environment] group. this option can be used multiple times πŸŽ€
  • --env-fd=FD β€” reads environment variables from the file descriptor FD, and sets them just like --env would. this is the move when you want to keep environment variables and their values from being visible to other users. privacy slay πŸ’…

each environment variable is in the form VAR=VALUE followed by a zero byte. this is the same format used by env -0 and /proc/*/environ πŸ”₯

  • --own-name=NAME β€” lets the application own the well-known name NAME on the session bus. this overrides the Context section from the application metadata. multiple uses allowed πŸ’œ
  • --talk-name=NAME β€” lets the application talk to the well-known name NAME on the session bus. this overrides the Context section from the application metadata. multiple uses allowed 🌸
  • --no-talk-name=NAME β€” does NOT let the application talk to the well-known name NAME on the session bus. this overrides the Context section from the application metadata. multiple uses allowed πŸ™ˆ
  • --system-own-name=NAME β€” lets the application own the well known name NAME on the system bus. if NAME ends with .*, it lets the application own all matching names. this overrides the Context section from the application metadata. multiple uses allowed πŸ‘‘
  • --system-talk-name=NAME β€” lets the application talk to the well known name NAME on the system bus. if NAME ends with .*, it lets the application talk to all matching names. this overrides the Context section from the application metadata. multiple uses allowed ⭐
  • --system-no-talk-name=NAME β€” does NOT let the application talk to the well known name NAME on the system bus. if NAME ends with .*, it lets the application talk to all matching names. this overrides the Context section from the application metadata. multiple uses allowed πŸ’€
  • --persist=FILENAME β€” if the application doesn't have access to the real homedir, this makes the (homedir-relative) path FILENAME a bind mount to the corresponding path in the per-application directory, so that location can be used for persistent data. this overrides the Context section from the application metadata. multiple uses allowed πŸ“
  • --reset β€” removes overrides. if an APP is given, it removes the overrides for that application; otherwise it removes the global overrides. clean slate, iconic 🧚
  • --show β€” shows overrides. if an APP is given, it shows the overrides for that application; otherwise it shows the global overrides. peek behind the curtain ✨
  • -v, --verbose β€” prints debug information while the command is processing. the receipts, basically πŸ“
  • --ostree-verbose β€” prints OSTree debug information while the command is processing. deeper receipts, for the OSTree girlies 🌈

πŸŽ€ EXAMPLES πŸŽ€

okay bestie, real talk β€” this is the part where it all clicks. three little lines, three big moods πŸ’–

$ flatpak override --nosocket=wayland org.gnome.gedit

this one's like... "bestie, no wayland for you." we're telling org.gnome.gedit it doesn't get the wayland socket, periodt. just blocking that one doorway and moving on with our lives ✨


$ flatpak override --filesystem=home org.mozilla.Firefox

and HERE'S the iconic one β€” we're handing org.mozilla.Firefox the keys to your entire home directory. that's a lot of trust, ngl. slay for a browser that genuinely needs it, but be a little discerning about who you give this to πŸ‘€


$ flatpak override --socket-if=x11:!has-wayland org.example.App

Grant X11 socket access only when not running in a Wayland session.

lowkey the most galaxy-brain of the three 🧠✨ conditional sockets!! we're saying: give org.example.App the x11 socket only if it does not have has-wayland. so on Wayland, no X11 for you; on a plain X11 session, come on in. it's giving "i contain multitudes" πŸ’…


✨ SEE ALSO ✨

go read these next, they're the whole friend group 🫢

  • flatpak(1) β€” the main character herself, all the general flatpak lore πŸ‘‘
  • flatpak-run(1) β€” everything about actually running apps, which is what all your overrides are quietly feeding into πŸ¦‹

and that's the page, bestie!! 🌸 this one's from the flatpak crew, section 1 of the manual β€” FLATPAK OVERRIDE(1), no cap. go forth and override responsibly, mwah πŸ’…πŸ’–πŸŒˆ

πŸ“¦ where this page comes from