### Flatpak Install Examples
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-command-reference.md
Examples demonstrating how to install Flatpak applications from various sources and configurations.
```APIDOC
## Flatpak Install Examples
### Description
Examples demonstrating how to install Flatpak applications from various sources and configurations.
### Examples
- Install a Flatpak application by name:
$ flatpak install gedit
- Install a Flatpak application from a specific remote (e.g., flathub):
$ flatpak install flathub org.gnome.gedit
- Install a Flatpak application to a specific installation:
$ flatpak --installation=default install flathub org.gnome.gedit
- Install a Flatpak application for the current user with a specific branch:
$ flatpak --user install flathub org.gnome.gedit//3.30
- Install a Flatpak application from a remote URL:
$ flatpak --user install https://flathub.org/repo/appstream/org.gnome.gedit.flatpakref
- Install a Flatpak application system-wide from a remote URL:
$ flatpak --system install org.gnome.gedit.flatpakref
```
--------------------------------
### Flatpak Installation Configuration Example
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-docs.html
Example of an installation configuration block for Flatpak. This defines the path, display name, and storage type for a specific installation.
```ini
[Installation "extra"]
Path=/location/of/sdcard
DisplayName=Extra Installation
StorageType=sdcard
```
--------------------------------
### Example Flatpak Installation Configuration
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-command-reference.md
This is an example of a configuration block for a Flatpak installation, specifying its path, display name, and storage type.
```ini
[Installation "extra"]
Path=/location/of/sdcard
DisplayName=Extra Installation
StorageType=sdcard
```
--------------------------------
### Automate Multiarch Setup in a Build Module
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/multiarch.md
Use a build module to create necessary directories and install the ld.so.conf configuration file.
```yaml
modules:
- name: bundle-setup
buildsystem: simple
build-commands:
- mkdir -p /app/lib/i386-linux-gnu
- mkdir -p /app/lib/debug/lib/i386-linux-gnu
- mkdir -p /app/lib/i386-linux-gnu/GL
- mkdir -p /app/lib/i386-linux-gnu/dri/intel-vaapi-driver
- install -Dm644 ld.so.conf /app/etc/ld.so.conf
sources:
- type: inline
dest-filename: ld.so.conf
contents: |
/app/lib32
/app/lib/i386-linux-gnu
```
--------------------------------
### Example .flatpakrepo File
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/hosting-a-repository.md
A sample .flatpakrepo file showing descriptive metadata and repository information. This file is used to add a repository to a Flatpak installation.
```default
[Flatpak Repo]
Title=Flathub
Url=https://dl.flathub.org/repo/
Homepage=https://flathub.org/
Comment=Central repository of Flatpak applications
Description=Central repository of Flatpak applications
Icon=https://dl.flathub.org/repo/logo.svg
GPGKey=mQINBFlD2sABEADsiUZUO...
```
--------------------------------
### GET /list
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-docs.html
Lists installed applications and runtimes.
```APIDOC
## GET /list
### Description
Lists the names of installed applications and runtimes with optional filtering.
### Method
GET
### Endpoint
flatpak list [OPTIONS]
### Parameters
#### Query Parameters
- **-u, --user** (boolean) - Optional - List per-user installations.
- **--system** (boolean) - Optional - List system-wide installations.
- **--installation** (string) - Optional - List specific system-wide installation.
- **--arch** (string) - Optional - Filter by architecture.
- **-d, --show-details** (boolean) - Optional - Show origin and size info.
- **--app** (boolean) - Optional - List applications only.
- **--runtime** (boolean) - Optional - List runtimes only.
- **--all, -a** (boolean) - Optional - List all.
```
--------------------------------
### flatpak_installation_launch
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Launches a Flatpak application. This function is used to start installed applications.
```APIDOC
## flatpak_installation_launch
### Description
Launches a Flatpak application.
### Method
(Not specified, likely a C function call)
### Endpoint
(Not applicable, C API)
### Parameters
(Not specified in the source)
### Request Example
(Not applicable, C API)
### Response
Returns `gboolean` indicating success or failure.
```
--------------------------------
### Build and Install Sample Electron App
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/electron.md
Command to build and install the sample Electron Flatpak application. It installs dependencies from Flathub, forces a clean build, and installs for the current user.
```bash
$ flatpak-builder build org.flathub.electron-sample-app.yml --install-deps-from=flathub --force-clean --user --install
```
--------------------------------
### Install Flatpak Build Directly
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-builder.md
The --install option allows for direct local installation of the Flatpak build, bypassing the need for a separate repository.
```bash
$ flatpak-builder --install
```
--------------------------------
### Install Application or Runtime
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-docs.html
Syntax for installing applications or runtimes from a remote or specific location.
```bash
flatpak install [OPTION...] [REMOTE] REF...
```
```bash
flatpak install [OPTION...] [--from|--bundle|--image] LOCATION
```
--------------------------------
### Install Flatpak Bundle
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Installs a Flatpak bundle from a GFile. This function takes the installation object, the bundle file, an optional progress callback, user data for the callback, a cancellable object, and an error pointer. It returns a reference to the newly installed app or NULL on failure.
```c
FlatpakInstallation *self,
GFile *file,
FlatpakProgressCallback progress,
gpointer progress_data,
GCancellable *cancellable,
GError **error);
```
--------------------------------
### Install Flatpak from USB (Older Versions)
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/usb-drives.md
For Flatpak versions before 1.8.0, use the standard `flatpak install` command to install an application from a USB drive as if it were an online repository.
```default
$ flatpak install flathub org.gnome.gedit
```
--------------------------------
### D-Bus Service File Example
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/conventions.md
D-Bus service files enable on-demand activation. The 'Name' key must match the filename (without .service), and the file is installed in ${FLATPAK_DEST}/share/dbus-1/services/.
```default
# Installed as /app/share/dbus-1/services/org.example.coolapp.service
[D-BUS Service]
Name=org.example.coolapp
Exec=/app/bin/coolapp --gapplication-service
```
```default
# Installed as /app/share/dbus-1/services/org.example.coolapp.foobar.service
[D-BUS Service]
Name=org.example.coolapp.foobar
Exec=/app/bin/coolapp --arg1 --gapplication-service
```
--------------------------------
### Run Application with GDB in Flatpak Sandbox
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/debugging.md
Starts an application under GDB within the Flatpak sandbox. Ensure debug packages are installed for meaningful traces. The application binary path is typically '/app/bin/'.
```bash
$ gdb /app/bin/
```
--------------------------------
### Install a Flatpak runtime
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/dependencies.md
Manually install a specific platform runtime using the flatpak install command.
```default
$ flatpak install flathub org.gnome.Platform//43
```
--------------------------------
### flatpak_installation_new_system
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Creates a new FlatpakInstallation object for the system-wide installation. This object can be used to interact with the system's Flatpak installations, such as listing remotes, installed applications, and runtimes.
```APIDOC
## flatpak_installation_new_system
### Description
Creates a new FlatpakInstallation object for the system-wide installation. This object can be used to interact with the system's Flatpak installations, such as listing remotes, installed applications, and runtimes.
### Function Signature
```c
FlatpakInstallation * flatpak_installation_new_system (GCancellable *cancellable)
```
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- None
### Request Example
```c
// Example usage (conceptual, requires proper context and error handling)
FlatpakInstallation *installation = flatpak_installation_new_system(NULL);
if (installation) {
// Use the installation object
// ...
g_object_unref(installation);
}
```
### Response
#### Success Response
- **FlatpakInstallation***: A pointer to a new `FlatpakInstallation` object representing the system installation. Returns NULL on failure.
#### Response Example
```json
{
"example": "Pointer to FlatpakInstallation object"
}
```
```
--------------------------------
### Serve Documentation Locally
Source: https://github.com/flatpak/flatpak-docs/blob/master/README.rst
Starts an HTTP server to view the built documentation in a browser. The server runs from the 'docs/_build/html' directory.
```bash
python3 -m http.server -d docs/_build/html
```
--------------------------------
### POST /install
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-docs.html
Installs an application or runtime from a specified source.
```APIDOC
## POST /install
### Description
Installs the application or runtime specified by REF. Supports various installation targets and configuration options.
### Method
POST
### Endpoint
flatpak install [OPTIONS] [REF...]
### Parameters
#### Query Parameters
- **--installation** (string) - Optional - Specifies a system-wide installation by name.
- **--arch** (string) - Optional - Specifies the architecture to install.
- **--subpath** (string) - Optional - Installs only a specific subpath.
- **--gpg-file** (string) - Optional - Path to GPG key for signature verification.
- **--no-deploy** (boolean) - Optional - Download without deploying.
- **--no-pull** (boolean) - Optional - Deploy without downloading.
- **--no-related** (boolean) - Optional - Skip related extensions.
- **--no-deps** (boolean) - Optional - Skip dependency verification.
- **--or-update** (boolean) - Optional - Update if already installed.
- **--app** (boolean) - Optional - Treat refs as apps.
- **--runtime** (boolean) - Optional - Treat refs as runtimes.
- **--sideload-repo** (string) - Optional - Path to extra local ostree repo.
- **--include-sdk** (boolean) - Optional - Install build SDK.
- **--include-debug** (boolean) - Optional - Install debug info.
- **-y, --assumeyes** (boolean) - Optional - Automatically answer yes.
- **--noninteractive** (boolean) - Optional - Minimal output for automation.
```
--------------------------------
### Example Configuration File
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-docs.html
An example of a Flatpak configuration file demonstrating various sections.
```APIDOC
## Example Configuration File
This is an example of a Flatpak configuration file.
```ini
[Application]
name=org.gnome.Calculator
runtime=org.gnome.Platform/x86_64/3.20
sdk=org.gnome.Sdk/x86_64/3.20
command=gnome-calculator
[Context]
shared=network;ipc;
sockets=x11;wayland;
filesystems=xdg-run/dconf;~/.config/dconf:ro;
[Session Bus Policy]
ca.desrt.dconf=talk
[Environment]
DCONF_USER_CONFIG_DIR=.config/dconf
[USB Devices]
enumerable-devices=0fd9:*;
hidden-devices=0fd9:0063;
[Extension org.gnome.Calculator.Locale]
directory=share/runtime/locale
subdirectories=true
[Extension org.gnome.Calculator.Debug]
directory=lib/debug
```
```
--------------------------------
### Get Flatpak Transaction Installation
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Retrieves the installation associated with a Flatpak transaction. The returned installation has a full transfer.
```c
flatpak_transaction_get_installation (self);
```
--------------------------------
### Create a Bundle
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/single-file-bundles.md
Example command to generate a .flatpak file from a local repository.
```default
$ flatpak build-bundle ~/repositories/apps dictionary.flatpak org.gnome.Dictionary
```
--------------------------------
### Get Flatpak Transaction Installation
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Retrieves the Flatpak installation associated with a transaction. The returned installation is owned by the caller.
```c
FlatpakInstallation *
flatpak_transaction_get_installation
(FlatpakTransaction *self);
```
--------------------------------
### Create and install application bundle
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/first-build.md
Commands for creating a single-file bundle for distribution and installing it on another system.
```bash
flatpak build-bundle repo hello.flatpak org.flatpak.Hello --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
```
```default
flatpak install --user hello.flatpak
```
--------------------------------
### Get Priority of Flatpak Installation
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Retrieves the numeric priority of a Flatpak installation. This can be used to determine the order in which installations are considered.
```c
gint
flatpak_installation_get_priority (
FlatpakInstallation *self);
```
--------------------------------
### Configure Flatpak Build Manifests
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/manifests.md
Examples demonstrating various buildsystem configurations including autotools, meson, and simple command execution.
```yaml
# Using autotools without configure
- name: ffnvcodec
buildsystem: autotools
no-autogen: true
make-install-args:
- PREFIX=/app
sources:
- type: git
url: https://github.com/FFmpeg/nv-codec-headers.git
commit: 43d91706e097565f57b311e567f0219838bcc2f6
tag: n11.1.5.3
# Using meson buildsystem
- name: libdrm
buildsystem: meson
builddir: true
config-opts:
- -Dtests=false
sources:
- type: git
url: https://gitlab.freedesktop.org/mesa/drm.git
tag: libdrm-2.4.124
# Using simple
- name: ffnvcodec
buildsystem: simple
build-commands:
- make -j$FLATPAK_BUILDER_N_JOBS PREFIX=/app install
sources:
- type: git
url: https://github.com/FFmpeg/nv-codec-headers.git
commit: 43d91706e097565f57b311e567f0219838bcc2f6
tag: n11.1.5.3
- name: libdrm
buildsystem: simple
build-commands:
- meson setup builddir --prefix=/app --libdir=/app/lib -Dtests=false
- ninja -C builddir install
sources:
- type: git
url: https://gitlab.freedesktop.org/mesa/drm.git
tag: libdrm-2.4.124
```
--------------------------------
### Get Flatpak Installation Details
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-docs.html
Functions to retrieve information about a Flatpak installation, such as whether it's user-specific or its installation path.
```APIDOC
## flatpak_installation_get_is_user ()
### Description
Returns whether the installation is for a user-specific location.
### Method
N/A (Function Signature)
### Endpoint
N/A
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
- **gboolean** - TRUE if the installation is a per-user installation.
#### Response Example
None
```
```APIDOC
## flatpak_installation_get_path ()
### Description
Returns the installation location for the given FlatpakInstallation.
### Method
N/A (Function Signature)
### Endpoint
N/A
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
- **GFile** (pointer) - An GFile representing the installation path.
#### Response Example
None
```
--------------------------------
### Get Default Languages for Flatpak Installation
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Retrieves the default languages for a Flatpak installation.
```c
char **
flatpak_installation_get_default_languages
(FlatpakInstallation *self,
```
--------------------------------
### Get Default Languages for Installation
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Retrieves the default languages used by the installation. This list can inform which locale extensions to install and which language-specific apps to display. An empty array indicates all languages should be installed.
```c
char **
flatpak_installation_get_default_languages
(FlatpakInstallation *self,
GError **error);
```
--------------------------------
### flatpak_installation_launch_full
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Launches an installed application with detailed control over the instance. This function allows for specifying various parameters like architecture, branch, and commit, and returns a FlatpakInstance for monitoring the running process.
```APIDOC
## flatpak_installation_launch_full
### Description
Launches an installed application. This function returns a `FlatpakInstance` that can be used to get information about the running instance. You can also use it to wait for the instance to be done with `g_child_watch_add()` if you pass the `FLATPAK_LAUNCH_FLAGS_DO_NOT_REAP` flag.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- None
### Method
(Not specified, likely a C function call)
### Endpoint
(Not applicable, C function)
### Parameters
#### Parameters
- **self** (FlatpakInstallation) - a `FlatpakInstallation`
- **flags** (FlatpakLaunchFlags) - set of `FlatpakLaunchFlags`
- **name** (string) - name of the app to launch
- **arch** (string) - which architecture to launch (default: current architecture). (nullable)
- **branch** (string) - which branch of the application (default: "master"). (nullable)
- **commit** (string) - the commit of `branch` to launch. (nullable)
- **instance_out** (FlatpakInstance) - return location for a `FlatpakInstance`. (nullable)
- **cancellable** (GCancellable) - a `GCancellable`. (nullable)
- **error** (GError) - return location for a `GError`
### Returns
- `TRUE`, unless an error occurred
### Since
1.1
```
--------------------------------
### Get Storage Type of Flatpak Installation
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Retrieves the storage type of a Flatpak installation. This indicates whether the installation uses system, user, or other storage mechanisms.
```c
FlatpakStorageType
flatpak_installation_get_storage_type (
FlatpakInstallation *self);
```
--------------------------------
### Get Flatpak Installation Configuration
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Retrieves a global configuration option for a Flatpak installation. Supported keys are detailed in flatpak_installation_set_config_sync().
```c
char *
flatpak_installation_get_config (FlatpakInstallation *self,
const char *key,
GCancellable *cancellable,
GError **error);
```
--------------------------------
### Get Installed Ref Information
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Retrieves information about an installed Flatpak reference, including available builds. This function is used to query details about specific installed Flatpak components.
```c
FlatpakInstalledRef *
flatpak_installation_get_installed_ref
(FlatpakInstallation *self,
FlatpakRefKind kind,
const char *name,
const char *arch,
const char *branch,
GCancellable *cancellable,
GError **error);
```
--------------------------------
### Create a Bundle with Runtime Repository
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/single-file-bundles.md
Example command to include a runtime repository URL within the bundle.
```default
$ flatpak build-bundle ~/repositories/apps dictionary.flatpak org.gnome.Dictionary --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
```
--------------------------------
### Install Application from .flatpakref File
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/using-flatpak.md
Installs an application using a .flatpakref file. This method can also add new remotes if specified in the file.
```bash
$ flatpak install https://flathub.org/repo/appstream/org.gimp.GIMP.flatpakref
```
--------------------------------
### GET flatpak_installation_get_id
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-docs.html
Returns the unique ID of the installation.
```APIDOC
## GET flatpak_installation_get_id
### Description
Returns the ID of the installation. Common IDs include 'default' for system and 'user' for user installations.
### Parameters
#### Path Parameters
- **self** (FlatpakInstallation) - Required - The installation instance
### Response
#### Success Response (200)
- **id** (string) - The installation ID
```
--------------------------------
### Launch Installed Application with Full Options
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-docs.html
Launches an installed application and returns a `FlatpakInstance` for managing the running instance. This allows for advanced control, such as waiting for the instance to complete using `g_child_watch_add()` if `FLATPAK_LAUNCH_FLAGS_DO_NOT_REAP` is used.
```c
flatpak_installation_launch_full (self, flags, name, arch, branch, commit, instance_out, cancellable, error)
```
--------------------------------
### GET flatpak_installation_get_installed_ref
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-docs.html
Returns detailed information about an installed reference.
```APIDOC
## GET flatpak_installation_get_installed_ref
### Description
Returns information about an installed ref, such as available builds, size, and location.
### Parameters
#### Path Parameters
- **self** (FlatpakInstallation) - Required - The installation instance
- **kind** (FlatpakRefKind) - Required - Whether this is an app or runtime
- **name** (char) - Required - Name of the app/runtime
- **arch** (char) - Optional - Architecture
- **branch** (char) - Optional - Branch
- **cancellable** (GCancellable) - Optional - A GCancellable instance
- **error** (GError) - Optional - Return location for error
### Response
#### Success Response (200)
- **FlatpakInstalledRef** (Object) - Information about the installed reference
```
--------------------------------
### GET flatpak_installation_get_display_name
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-docs.html
Returns the display name associated with the installation.
```APIDOC
## GET flatpak_installation_get_display_name
### Description
Returns the display name of the installation. May return NULL if no display name is set.
### Parameters
#### Path Parameters
- **self** (FlatpakInstallation) - Required - The installation instance
### Response
#### Success Response (200)
- **display_name** (string) - The display name of the installation
```
--------------------------------
### Example Flatpak Build Command
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-docs.html
An example command for building a Flatpak application using rpmbuild.
```bash
flatpak build /build/my-app rpmbuild my-app.src.rpm
```
--------------------------------
### GET flatpak_installation_get_min_free_space_bytes
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-docs.html
Retrieves the minimum free space configuration for the installation.
```APIDOC
## GET flatpak_installation_get_min_free_space_bytes
### Description
Returns the min-free-space config value from the OSTree repository of this installation.
### Parameters
#### Path Parameters
- **self** (FlatpakInstallation) - Required - The installation instance
- **out_bytes** (guint64) - Required - Location to store the result
- **error** (GError) - Optional - Return location for error
### Response
#### Success Response (200)
- **result** (gboolean) - Returns TRUE if successful
```
--------------------------------
### Configure a custom installation
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/tips-and-tricks.md
Set up a custom installation directory, such as on an external drive, by creating a configuration file.
```default
$ sudo mkdir -p /etc/flatpak/installations.d
```
```default
$ sudoedit /etc/flatpak/installations.d/extra.conf
```
```default
[Installation "extra"]
Path=/run/media/mwleeds/ext4_4tb/flatpak/
DisplayName=Extra Installation
StorageType=harddisk
```
```default
$ flatpak --installation=extra remote-add flathub https://flathub.org/repo/flathub.flatpakrepo
```
```default
$ flatpak --installation=extra install flathub org.inkscape.Inkscape
```
--------------------------------
### Make a Specific Application Branch Current (User Installation)
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-docs.html
Example of using the make-current command for a user-specific installation, targeting the 'org.gnome.gedit' application and its '3.14' branch.
```bash
$ flatpak --user make-current org.gnome.gedit 3.14
```
--------------------------------
### Build and install application
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/first-build.md
Uses flatpak-builder to compile the application modules and install the resulting package.
```default
flatpak-builder --force-clean --user --install-deps-from=flathub --repo=repo --install builddir org.flatpak.Hello.yml
```
--------------------------------
### Get Installed Size of Flatpak Remote Ref
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Retrieves the installed size of a Flatpak remote reference. This function is useful for understanding disk space usage.
```c
guint64
flatpak_remote_ref_get_installed_size (FlatpakRemoteRef *self);
```
--------------------------------
### GET flatpak_get_system_installations
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-docs.html
Lists the system installations based on current configuration and availability.
```APIDOC
## GET flatpak_get_system_installations
### Description
Lists the system installations according to the current configuration and current availability.
### Method
GET
### Endpoint
flatpak_get_system_installations()
### Parameters
#### Query Parameters
- **cancellable** (GCancellable) - Optional - A GCancellable instance.
- **error** (GError) - Optional - Return location for a GError.
### Response
#### Success Response (200)
- **installations** (GPtrArray) - A GPtrArray of FlatpakInstallation instances.
```
--------------------------------
### Install a Bundle Directly
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/single-file-bundles.md
Command to install a bundle file without prior repository import.
```default
$ flatpak install dictionary.flatpak
```
--------------------------------
### Get System Installations
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Lists available system Flatpak installations based on configuration and current availability. Requires GCancellable for asynchronous operations and GError for error reporting.
```c
GPtrArray *
flatpak_get_system_installations (GCancellable *cancellable,
GError **error);
```
--------------------------------
### Get Installed Size of Transaction Operation
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Retrieves the installed size for a given Flatpak transaction operation. This value is available when the transaction is resolved. For uninstall operations, it returns 0.
```c
guint64
flatpak_transaction_operation_get_installed_size
(FlatpakTransactionOperation *self);
```
--------------------------------
### Flatpak Reference File Example
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-command-reference.md
A sample .flatpakref file demonstrating the use of various configuration keys including title, branch, and GPG keys.
```ini
[Flatpak Ref]
Title=gedit
Name=org.gnome.gedit
Branch=stable
Url=http://sdk.gnome.org/repo-apps/
IsRuntime=false
GPGKey=mQENBFUUCGcBCAC/K9WeV4xCaKr3NKRqPXeY5mpaXAJyasLqCtrDx92WUgbu0voWrhohNAKpqizod2dvzc/XTxm3rHyIxmNfdhz1gaGhynU75Qw4aJVcly2eghTIl++gfDtOvrOZo/VuAq30f32dMIgHQdRwEpgCwz7WyjpqZYltPAEcCNL4MTChAfiHJeeiQ5ibystNBW8W6Ymf7sO4m4g5+/aOxI54oCOzD9TwBAe+yXcJJWtc2rAhMCjtyPJzxd0ZVXqIzCe1xRvJ6Rq7YCiMbiM2DQFWXKnmYQbj4TGNMnwNdAajCdrcBWEMSbzq7EzuThIJRd8Ky4BkEe1St6tuqwFaMZz+F9eXABEBAAG0KEdub21lIFNESyAzLjE2IDxnbm9tZS1vcy1saXN0QGdub21lLm9yZz6JATgEEwECACIFAlUUCGcCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEArkz6VV0VKBa5cH/0vXa31YgEjNk78gGFXqnQxdD1WYA87OYxDi189l4lA802EFTF4wCBuZyDOqdd5BhS3Ab0cR778DmZXRUP2gwe+1zTJypU2JMnDpkwJ4NK1VP6/tE4SAPrznBtmb76BKaWBqUfZ9Wq1zg3ugvqkZB/Exq+usypIOwQVp1KL58TrjBRda0HvRctzkNhr0qYAtkfLFe0GvksBp4vBm8uGwAx7fw/HbhIjQ9pekTwvB+5GwDPO/tSip/1bQfCS+XJB8Ffa04HYPLGedalnWBrwhYY+G/kn5Zh9L/AC8xeLwTJTHM212rBjPa9CWs9C6a57MSaeGIEHLC1hEyiJJ15w8jmY=
DeployCollectionID=org.gnome.Apps
```
--------------------------------
### Install application via .flatpakref
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/repositories.md
Commands to install an application using a remote or local .flatpakref file.
```bash
$ flatpak install https://flathub.org/repo/appstream/fr.free.Homebank.flatpakref
```
```bash
$ flatpak install fr.free.Homebank.flatpakref
```
--------------------------------
### flatpak_installation_get_display_name
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Gets the display name of a Flatpak installation. This is the human-readable name shown to users.
```APIDOC
## flatpak_installation_get_display_name
### Description
Gets the display name of a Flatpak installation.
### Method
(Not specified, likely a C function call)
### Endpoint
(Not applicable, C API)
### Parameters
(Not specified in the source)
### Request Example
(Not applicable, C API)
### Response
Returns a `const char*` representing the display name.
```
--------------------------------
### flatpak_installation_new_user
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Creates a new FlatpakInstallation for the per-user installation.
```APIDOC
## flatpak_installation_new_user
### Description
Creates a new FlatpakInstallation for the per-user installation.
### Parameters
#### Path Parameters
- **cancellable** (GCancellable) - Optional - a GCancellable.
- **error** (GError**) - Required - return location for a GError
### Returns
- **FlatpakInstallation** - a new FlatpakInstallation. (transfer full)
```
--------------------------------
### FlatpakRemoteRef Functions
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-docs.html
Functions for interacting with FlatpakRemoteRef objects to get installed size and metadata.
```APIDOC
## flatpak_remote_ref_get_installed_size
### Description
Returns the installed size of the ref.
### Method
N/A (Function)
### Endpoint
N/A
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
- **installed_size** (guint64) - The installed size of the ref.
#### Response Example
```json
{
"installed_size": 123456789
}
```
## flatpak_remote_ref_get_metadata
### Description
Returns the app metadata from the metadata cache of the ref.
### Method
N/A (Function)
### Endpoint
N/A
### Parameters
#### Path Parameters
None
#### Query Parameters
None
#### Request Body
None
### Request Example
None
### Response
#### Success Response (200)
- **metadata** (GBytes) - A GBytes object containing the metadata file contents or NULL.
#### Response Example
```json
{
"metadata": "...base64_encoded_metadata..."
}
```
```
--------------------------------
### GET flatpak_installation_get_current_installed_app
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-docs.html
Retrieves the last build of a specific reference name that was installed locally.
```APIDOC
## GET flatpak_installation_get_current_installed_app
### Description
Get the last build of reference name that was installed, or NULL if the reference has never been installed locally.
### Parameters
#### Path Parameters
- **self** (FlatpakInstallation) - Required - The installation instance
- **name** (char) - Required - The name of the app
- **cancellable** (GCancellable) - Optional - A GCancellable instance
- **error** (GError) - Optional - Return location for error
### Response
#### Success Response (200)
- **FlatpakInstalledRef** (Object) - The installed reference information
```
--------------------------------
### Get Minimum Free Space for Flatpak Installation
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Retrieves the minimum free disk space required for a Flatpak installation. This is useful to check before performing operations that might consume significant disk space.
```c
gboolean
flatpak_installation_get_min_free_space_bytes (FlatpakInstallation *self,
guint64 *out_bytes,
GError **error);
```
--------------------------------
### Build and Install Flatpak Application
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/dotnet.md
Use Flatpak Builder to build and install your application. This command compiles the application, creates the Flatpak, and installs it locally. The `--force-clean` option ensures a clean build.
```shell
flatpak-builder build-dir --user --force-clean --install --repo=repo .yaml
```
--------------------------------
### FlatpakTransactionProgress::get_start_time
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Gets the time at which this operation has started, as monotonic time. This function is part of the FlatpakTransactionProgress API.
```APIDOC
## FlatpakTransactionProgress::get_start_time
### Description
Gets the time at which this operation has started, as monotonic time.
### Parameters
#### Path Parameters
- None
#### Query Parameters
- None
#### Request Body
- None
### Parameters
#### Parameters
- **self** (FlatpakTransactionProgress *) - A FlatpakTransactionProgress
### Returns
#### Success Response
- **return value** (time_t) - the start time
### Since
1.1.2
```
--------------------------------
### Flatpak Preinstall Configuration
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-command-reference.md
Example configuration for preinstalling a Flatpak application or runtime. Specifies the branch and whether it's a runtime.
```ini
[Flatpak Preinstall org.gnome.Loupe]
Branch=stable
IsRuntime=false
```
--------------------------------
### Example Flatpak Repository Configuration
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-docs.html
This is an example of a .flatpakref file, which contains configuration details for a Flatpak repository. It includes essential information like the repository's title, URL, GPG key, and collection ID for application distribution.
```ini
[Flatpak Repo]
Title=gedit
Url=http://sdk.gnome.org/repo-apps/
GPGKey=mQENBFUUCGcBCAC/K9WeV4xCaKr3NKRqPXeY5mpaXAJyasLqCtrDx92WUgbu0voWrhohNAKpqizod2dvzc/XTxm3rHyIxmNfdhz1gaGhynU75Qw4aJVcly2eghTIl++gfDtOvrOZo/VuAq30f32dMIgHQdRwEpgCwz7WyjpqZYltPAEcCNL4MTChAfiHJeeiQ5ibystNBW8W6Ymf7sO4m4g5+/aOxI54oCOzD9TwBAe+yXcJJWtc2rAhMCjtyPJzxd0ZVXqIzCe1xRvJ6Rq7YCiMbiM2DQFWXKnmYQbj4TGNMnwNdAajCdrcBWEMSbzq7EzuThIJRd8Ky4BkEe1St6tuqwFaMZz+F9eXABEBAAG0KEdub21lIFNESyAzLjE2IDxnbm9tZS1vcy1saXN0QGdub21lLm9yZz6JATgEEwECACIFAlUUCGcCGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEArkz6VV0VKBa5cH/0vXa31YgEjNk78gGFXqnQxdD1WYA87OYxDi189l4lA802EFTF4wCBuZyDOqdd5BhS3Ab0cR778DmZXRUP2gwe+1zTJypU2JMnDpkwJ4NK1VP6/tE4SAPrznBtmb76BKaWBqUfZ9Wq1zg3ugvqkZB/Exq+usypIOwQVp1KL58TrjBRda0HvRctzkNhr0qYAtkfLFe0GvksBp4vBm8uGwAx7fw/HbhIjQ9pekTwvB+5GwDPO/tSip/1bQfCS+XJB8Ffa04HYPLGedalnWBrwhYY+G/kn5Zh9L/AC8xeLwTJTHM212rBjPa9CWs9C6a57MSaeGIEHLC1hEyiJJ15w8jmY=
DeployCollectionID=org.gnome.Apps
```
--------------------------------
### flatpak_installed_ref_get_appdata_name
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Retrieves the name of the application from the appdata of an installed Flatpak reference. This function is used to get the human-readable name of the Flatpak.
```APIDOC
## flatpak_installed_ref_get_appdata_name
### Description
Retrieves the name of the application from the appdata of an installed Flatpak reference.
### Method
N/A (C function)
### Endpoint
N/A (C function)
### Parameters
None explicitly documented in this snippet.
### Response
#### Success Response
- **const char** *: Pointer to a string containing the application name.
### Response Example
N/A (C function return value)
```
--------------------------------
### Flatpak manifest with apply_extra script
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/module-sources.md
Example of a manifest module using an apply_extra script to extract and install components from a Debian package.
```yaml
- name: foo
buildsystem: simple
build-commands:
- install -Dm755 apply_extra ${FLATPAK_DEST}/bin/apply_extra
- install -Dm644 -t ${FLATPAK_DEST}/share/metainfo/ ${FLATPAK_ID}.metainfo.xml
- install -Dm644 -t ${FLATPAK_DEST}/share/applications/ ${FLATPAK_ID}.desktop
- install -Dm644 -t ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/ ${FLATPAK_ID}.svg
- ln -s ${FLATPAK_DEST}/extra/bin/foo_binary ${FLATPAK_DEST}/bin/foo_binary
sources:
- type: script
dest-filename: apply_extra
commands:
- bsdtar --to-stdout -xf foo.deb data.* | bsdtar -xf -
- rm foo.deb
```
--------------------------------
### flatpak_installation_install_full
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Installs a full application or runtime from a given repository. This function is used to add new applications or runtimes to the system.
```APIDOC
## flatpak_installation_install_full
### Description
Installs a full application or runtime.
### Method
(Not applicable, this is an SDK function)
### Parameters
#### Path Parameters
(None)
#### Query Parameters
(None)
#### Request Body
(None)
### Parameters
- **self** (*FlatpakInstallation*) - The FlatpakInstallation object.
- **flags** (*FlatpakInstallFlags*) - Flags to control the installation behavior.
- **kind** (*FlatpakRefKind*) - The kind of reference to install (e.g., app, runtime).
- **name** (*const char wo-star*) - The name of the application or runtime.
- **arch** (*const char wo-star*) - The architecture of the application or runtime.
- **branch** (*const char wo-star*) - The branch of the application or runtime.
- **progress** (*FlatpakProgressCallback*) - Callback function for progress updates.
- **progress_data** (*gpointer*) - User data for the progress callback.
- **cancellable** (*GCancellable*) - A GCancellable object for cancellation.
- **error** (*GError wo-star*) - Return location for a GError.
### Returns
- **FlatpakInstalledRef wo-star** - The ref for the newly installed app or NULL on failure.
### Response Example
(None)
### Error Handling
- **FLATPAK_ERROR_NOT_INSTALLED**: If the specified package is not installed.
- Returns NULL on failure.
```
--------------------------------
### Get Default Locales for Installation
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-api-reference.md
Similar to get_default_languages, but includes territory information (e.g., en_US). Strings are formatted according to setlocale().
```c
char **
flatpak_installation_get_default_locales
(FlatpakInstallation *self,
GError **error);
```
--------------------------------
### Launch Application (Full)
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-docs.html
Launches an installed Flatpak application and returns a FlatpakInstance for managing the running process.
```APIDOC
## flatpak_installation_launch_full()
### Description
Launches an installed application. Similar to `flatpak_installation_launch()`, but returns a `FlatpakInstance` for managing the running instance. This instance can be used with `g_child_watch_add()` if `FLATPAK_LAUNCH_FLAGS_DO_NOT_REAP` is passed.
### Method
(Not applicable, this is a function description)
### Endpoint
(Not applicable)
### Parameters
- **self** (FlatpakInstallation) - The FlatpakInstallation object.
- **flags** (enum FlatpakLaunchFlags) - Flags for the launch operation.
- **name** (string) - The name of the app to launch.
- **arch** (string, nullable) - The architecture to launch. Defaults to the current architecture.
- **branch** (string, nullable) - The branch of the application. Defaults to "master".
- **commit** (string, nullable) - The commit of the branch to launch.
- **instance_out** (FlatpakInstance, nullable) - Output parameter for the FlatpakInstance.
- **cancellable** (GCancellable, nullable) - A cancellable object.
- **error** (GError, nullable) - Return location for a GError.
### Returns
- **boolean** - TRUE on success, unless an error occurred.
```
--------------------------------
### GET flatpak remotes
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/flatpak-command-reference.md
Lists the known remote repositories, in priority order, with options to filter by installation type or display additional details.
```APIDOC
## GET flatpak remotes
### Description
Lists the known remote repositories, in priority order. By default, both per-user and system-wide installations are shown.
### Method
GET
### Endpoint
flatpak remotes
### Parameters
#### Query Parameters
- **--user** (flag) - Optional - Show the per-user configuration.
- **--system** (flag) - Optional - Show the default system-wide configuration.
- **--installation=NAME** (string) - Optional - Show a system-wide installation by NAME.
- **--show-details** (flag) - Optional - Show more information for each repository.
- **--show-disabled** (flag) - Optional - Show disabled repositories.
- **--columns=FIELD** (string) - Optional - Specify what information to show about each repository.
```
--------------------------------
### Launch Installed Application
Source: https://github.com/flatpak/flatpak-docs/blob/master/docs/libflatpak-docs.html
Launches an installed application. Use `flatpak_installation_get_installed_ref()` or `flatpak_installation_get_current_installed_app()` to find available builds for the `commit` parameter.
```c
flatpak_installation_launch (self, name, arch, branch, commit, cancellable, error)
```