<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<refentry id="flatpak">

    <refentryinfo>
        <title>flatpak</title>
        <productname>flatpak</productname>

        <authorgroup>
            <author>
                <contrib>Developer</contrib>
                <firstname>Alexander</firstname>
                <surname>Larsson</surname>
                <email>alexl@redhat.com</email>
            </author>
        </authorgroup>
    </refentryinfo>

    <refmeta>
        <refentrytitle>flatpak</refentrytitle>
        <manvolnum>1</manvolnum>
    </refmeta>

    <refnamediv>
        <refname>flatpak</refname>
        <refpurpose>Build, install and run applications and runtimes</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
            <cmdsynopsis>
                <command>flatpak</command>
                <arg choice="opt" rep="repeat">OPTION</arg>
                <arg choice="req">COMMAND</arg>
            </cmdsynopsis>
    </refsynopsisdiv>

    <refsect1>
        <title>Description</title>

        <para>
            Flatpak is a tool for managing applications and the runtimes
            they use. In the Flatpak model, applications can be built and
            distributed independently from the host system they are used
            on, and they are isolated from the host system ('sandboxed')
            to some degree, at runtime.
        </para>

        <para>
            Flatpak can operate in system-wide or per-user mode. The system-wide
            data (runtimes, applications and configuration) is located in
            <filename>$prefix/var/lib/flatpak/</filename>, and the per-user
            data is in <filename>$HOME/.local/share/flatpak/</filename>.
            Below these locations, there is a local repository in the
            <filename>repo/</filename> subdirectory and installed runtimes
            and applications are in the corresponding <filename>runtime/</filename>
            and <filename>app/</filename> subdirectories.
        </para>

       <para>
            System-wide remotes can be statically preconfigured by dropping
            flatpakrepo files into <filename>/etc/flatpak/remotes.d/</filename>.
       </para>

        <para>
            In addition to the system-wide installation in <filename>$prefix/var/lib/flatpak/</filename>,
            which is always considered the default one unless overridden, more
            system-wide installations can be defined via configuration files in
            <filename>/etc/flatpak/installations.d/</filename>, which must define
            at least the id of the installation and the absolute path to it.
            Other optional parameters like <arg choice="plain">DisplayName</arg>,
            <arg choice="plain">Priority</arg> or <arg choice="plain">StorageType</arg>
            are also supported.
        </para>

        <para>
            Flatpak uses OSTree to distribute and deploy data. The repositories
            it uses are OSTree repositories and can be manipulated with the
            <command>ostree</command> utility. Installed runtimes and
            applications are OSTree checkouts.
        </para>

        <para>
            Basic commands for building flatpaks such as build-init, build and build-finish
            are included in the flatpak utility. For higher-level build support, see
            the separate 
            <citerefentry><refentrytitle>flatpak-builder</refentrytitle><manvolnum>1</manvolnum></citerefentry> tool.
        </para>
    </refsect1>

    <refsect1>
        <title>Options</title>

        <para>
            The following global options are understood. Individual commands have their
            own options.
        </para>

        <variablelist>
            <varlistentry>
                <term><option>-h</option></term>
                <term><option>--help</option></term>

                <listitem><para>
                    Show help options and exit.
                </para></listitem>
            </varlistentry>

            <varlistentry>
                <term><option>-v</option></term>
                <term><option>--verbose</option></term>

                <listitem><para>
                    Show debug information during command processing. Use -vv for more detail.
                </para></listitem>
            </varlistentry>

            <varlistentry>
                <term><option>--ostree-verbose</option></term>

                <listitem><para>
                    Show OSTree debug information during command processing.
                </para></listitem>
            </varlistentry>

            <varlistentry>
                <term><option>--version</option></term>

                <listitem><para>
                    Print version information and exit.
                </para></listitem>
            </varlistentry>

           <varlistentry>
                <term><option>--default-arch</option></term>

                <listitem><para>
                    Print the default arch and exit.
                </para></listitem>
            </varlistentry>

            <varlistentry>
                <term><option>--supported-arches</option></term>

                <listitem><para>
                    Print the supported arches in priority order and exit.
                </para></listitem>
            </varlistentry>

            <varlistentry>
                <term><option>--gl-drivers</option></term>

                <listitem><para>
                    Print the list of active gl drivers and exit.
                </para></listitem>
            </varlistentry>

            <varlistentry>
                <term><option>--installations</option></term>

                <listitem><para>
                    Print paths of system installations and exit.
                </para></listitem>
            </varlistentry>

        </variablelist>
    </refsect1>

    <refsect1>
        <title>Commands</title>

        <para>Commands for managing installed applications and runtimes:</para>

        <variablelist>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-install</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Install an application or a runtime from a remote or bundle.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-update</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Update an installed application or runtime.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-uninstall</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Uninstall an installed application or runtime.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-mask</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Mask out updates and automatic installation
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-list</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    List installed applications and/or runtimes.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-info</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Show information for an installed application or runtime.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-history</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Show history.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-config</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Manage flatpak configuration.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-repair</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Repair flatpak installation.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-create-usb</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Copy apps and/or runtimes onto removable media.
                </para></listitem>
            </varlistentry>
        </variablelist>


        <para>Commands for finding applications and runtimes:</para>

        <variablelist>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-search</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Search for applications and runtimes.
                </para></listitem>
            </varlistentry>
        </variablelist>


        <para>Commands for running applications:</para>

        <variablelist>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-run</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Run an application.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-kill</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Stop a running application.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-override</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Override permissions for an application.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-make-current</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Specify the default version to run.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-enter</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Enter the namespace of a running application.
                </para></listitem>
            </varlistentry>
        </variablelist>

        <para>Commands for managing file access:</para>

        <variablelist>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-document-export</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Grant an application access to a specific file.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-document-unexport</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Revoke access to a specific file.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-document-info</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Show information about a specific file.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-documents</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    List exported files.
                </para></listitem>
            </varlistentry>
        </variablelist>

        <para>Commands for managing the dynamic permission store:</para>

        <variablelist>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-permission-remove</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Remove item from permission store.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-permissions</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    List permissions.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-permission-show</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Show app permissions.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-permission-reset</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Reset app permissions.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-permission-set</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Set app permissions.
                </para></listitem>
            </varlistentry>
        </variablelist>

        <para>Commands for managing remote repositories:</para>

        <variablelist>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-remotes</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    List all configured remote repositories.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-remote-add</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Add a new remote repository.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-remote-modify</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Modify properties of a configured remote repository.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-remote-delete</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Delete a configured remote repository.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-remote-ls</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    List contents of a configured remote repository.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-remote-info</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Show information about a ref in a configured remote repository.
                </para></listitem>
            </varlistentry>
        </variablelist>

        <para>Commands for building applications:</para>

        <variablelist>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-build-init</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Initialize a build directory.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-build</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Run a build command in a build directory.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-build-finish</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Finalizes a build directory for export.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-build-export</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Export a build directory to a repository.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-build-bundle</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Create a bundle file from a ref in a local repository.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-build-import-bundle</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Import a file bundle into a local repository.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-build-sign</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Sign an application or runtime after its been exported.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-build-update-repo</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Update the summary file in a repository.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-build-commit-from</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Create a new commit based on an existing ref.
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-repo</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Print information about a repo.
                </para></listitem>
            </varlistentry>
        </variablelist>

        <para>Commands available inside the sandbox:</para>

        <variablelist>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-spawn</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>

                <listitem><para>
                    Run a command in another sandbox.
                </para></listitem>
            </varlistentry>
        </variablelist>

    </refsect1>

    <refsect1>
        <title>File formats</title>

        <para>File formats that are used by Flatpak commands:</para>

        <variablelist>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-flatpakref</refentrytitle><manvolnum>5</manvolnum></citerefentry></term>

                <listitem><para>
                    Reference to a remote for an application or runtime
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-flatpakrepo</refentrytitle><manvolnum>5</manvolnum></citerefentry></term>

                <listitem><para>
                    Reference to a remote
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-remote</refentrytitle><manvolnum>5</manvolnum></citerefentry></term>

                <listitem><para>
                    Configuration for a remote 
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-installation</refentrytitle><manvolnum>5</manvolnum></citerefentry></term>

                <listitem><para>
                    Configuration for an installation location
                </para></listitem>
            </varlistentry>
            <varlistentry>
                <term><citerefentry><refentrytitle>flatpak-metadata</refentrytitle><manvolnum>5</manvolnum></citerefentry></term>

                <listitem><para>
                    Information about an application or runtime
                </para></listitem>
            </varlistentry>
        </variablelist>
    </refsect1>

    <refsect1>
        <title>Environment</title>
            <para>
              Besides standard environment variables such as <envar>XDG_DATA_DIRS</envar> and
              <envar>XDG_DATA_HOME</envar>, flatpak is consulting some of its own.
            </para>
            <variablelist>
                <varlistentry>
                    <term><envar>FLATPAK_USER_DIR</envar></term>

                    <listitem><para>
                      The location of the per-user installation. If this is not set,
                      <filename>$XDG_DATA_HOME/flatpak</filename> is used.
                    </para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><envar>FLATPAK_SYSTEM_DIR</envar></term>

                    <listitem><para>
                      The location of the default system-wide installation. If this is not set,
                      <filename>/var/lib/flatpak</filename> is used (unless overridden at build
                      time by --localstatedir or --with-system-install-dir).
                    </para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><envar>FLATPAK_SYSTEM_CACHE_DIR</envar></term>

                    <listitem><para>
                      The location where temporary child repositories will be created during pulls
                      into the system-wide installation.  If this is not set, a directory in
                      <filename>/var/tmp/</filename> is used. This is useful because it is more
                      likely to be on the same filesystem as the system repository (thus increasing
                      the chances for e.g. reflink copying), and we can avoid filling the user's
                      home directory with temporary data.
                    </para></listitem>
                </varlistentry>
                <varlistentry>
                    <term><envar>FLATPAK_CONFIG_DIR</envar></term>

                    <listitem><para>
                      The location of flatpak site configuration. If this is not set,
                      <filename>/etc/flatpak</filename> is used (unless overridden at build
                      time by --sysconfdir).
                    </para></listitem>
                </varlistentry>
            </variablelist>
    </refsect1>

    <refsect1>
        <title>See also</title>

            <para>
                <citerefentry><refentrytitle>ostree</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
                <citerefentry><refentrytitle>ostree.repo</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
                <citerefentry><refentrytitle>flatpak-remote</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
                <citerefentry><refentrytitle>flatpak-installation</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
                <ulink url="https://www.flatpak.org">https://www.flatpak.org</ulink>
            </para>

    </refsect1>

</refentry>
