Skip to content

flatpak Operations

Manage flatpak packages. See https://www.flatpak.org/

Facts used in these operations: flatpak.FlatpakPackages.

flatpak.packages

Install/remove a flatpak package

flatpak.packages(
         packages: 'str | list[str] | None' = None,
         remote: 'str | None' = None,
         present: 'bool' = True,
         user: 'bool' = False,
         **kwargs,
    )
  • packages: List of packages
  • remote: Source from which to install the application or runtime
  • present: whether the package should be installed
  • user: use the current user's installation instead of Flatpak's default

Examples:

from pyinfra.operations import flatpak
# Install vlc flatpak
flatpak.packages(
    name="Install vlc",
    packages="org.videolan.VLC",
)

# Install vlc flatpak from flathub
flatpak.packages(
    name="Install vlc",
    packages="org.videolan.VLC",
    remote="flathub",
)

# Install vlc flatpak for the current user
flatpak.packages(
    name="Install vlc",
    packages="org.videolan.VLC",
    remote="flathub",
    user=True,
)

# Install multiple flatpaks
flatpak.packages(
    name="Install vlc and kodi",
    packages=["org.videolan.VLC", "tv.kodi.Kodi"],
)

# Remove vlc
flatpak.packages(
    name="Remove vlc",
    packages="org.videolan.VLC",
    present=False,
)

Global arguments

This operation also inherits all global arguments.