flatpak‐install - uhop/dotfiles GitHub Wiki
Install flatpak packages, dispatching between --system and --user scopes with automatic deduplication.
flatpak-install [options] <package>...| Option | Description |
|---|---|
--system |
Force system install (errors if not viable) |
--user |
Force user install |
--remote=REMOTE |
Flatpak remote to install from (default: flathub) |
-n, --dry-run |
Show the plan without installing |
--verbose |
Show per-package dispatch decisions |
-y, --yes |
Assume yes to flatpak prompts |
-v, --version |
Show version |
-h, --help |
Show help |
For each input package:
-
Dedup. If
flatpak info <pkg>already succeeds in either scope, the package is skipped. Dedup is cross-scope: if one user on a machine already installed Firefox system-wide, every other user sees it and skips. -
Scope choice. A single scope is chosen for all remaining packages:
-
systemwhen the managed polkit rule at/usr/local/share/polkit-1/rules.d/90-flatpak-ssh.rulesis deployed and the current user is insudoorwheel— polkit handles the D-Bus authorization and the install works over SSH. -
systemwhensudo -n truesucceeds — the install is wrapped insudo -n flatpak install --system ...so it bypasses polkit via root rather than tripping a polkit prompt that has nowhere to go over SSH. -
userotherwise — no privileges required, installs into~/.local/share/flatpak.
-
-
Batch install. Remaining packages are installed in a single
flatpak installcall to the chosen scope.
--system or --user override the auto-decision; --system errors if no viable path exists.
-
flatpakmust be installed. - The target remote must be configured in the chosen scope. Flathub is installed system-wide by
run_onchange_before_install-packages.sh.tmplon GUI hosts. - The polkit rule is deployed automatically by
run_onchange_after_install-flatpak-polkit.sh.tmpl; see Application Notes § flatpak for the rationale and the rule body.
flatpak-install --dry-run org.mozilla.firefox com.github.tchx84.Flatseal
flatpak-install -y org.mozilla.firefox
flatpak-install --user org.videolan.VLC
flatpak-install --remote=my-remote org.example.App~/.local/libs/flatpak-install.sh is a sourceable bash library that exposes the probes separately:
-
flatpak_install::has_polkit_rule— 0 if the managed polkit rule file exists. -
flatpak_install::in_sudo_group— 0 if the user is insudo/wheel. -
flatpak_install::can_sudo_nopasswd— 0 ifsudo -n truesucceeds. -
flatpak_install::can_system— 0 if a--systeminstall is viable non-interactively. -
flatpak_install::system_needs_sudo— 0 if--systeminstall must be wrapped insudo(no polkit path). -
flatpak_install::chosen_scope— echoessystemoruser. -
flatpak_install::scope_of <pkg>— echoessystem,user, ornone. -
flatpak_install::has_remote <remote> [system|user]— 0 if the remote is configured.
The library is pure bash and has no options.bash dependency; other scripts can source it directly.