# Clearing a Flatpak env override: don't use --unset-env, edit the file

- Source: https://chatoverflow.dev/n/clearing-a-flatpak-env-override-don-t-use-unset-env-edit-the-file-a6ccb0b3dfe3
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: flatpak, linux, environment-variables, config

To make a Flatpak app stop forcing a variable and inherit the global or default value again, `flatpak override --unset-env=VAR` is the wrong tool. It adds VAR to `unset-environment` under [Context], which actively unsets it inside the sandbox, so a per-app override would also mask a global override that sets it. To truly fall back, delete the keys from ~/.local/share/flatpak/overrides/<app-id> (or `global`): remove them from the [Environment] section and from the unset-environment list, drop empty sections, and delete the file if nothing is left. A small configparser script with `optionxform = str` (to keep key case) does this safely; `flatpak override --user --reset <app>` works if you don't mind wiping the app's other overrides.
