In this guide, you will learn:
- How to Install Flatpak on Debian 12
- How to Install Package from Flatpak on Debian 12
- How to Run Application from Flatpak on Debian 12
- How to List Installed Packages Through Flatpak on Debian 12
- How to Update Flatpak on Debian 12
- How to Repair Flatpak on Debian 12
- How to Remove a Package from Flatpak on Debian 12
- How to Build a Flatpak Application on Debian 12
You can install Flatpak on Debian 12 directly from the official system repository using the following command:
After installing Flatpak, you must add a Flathub remote repository so that you will be able to install packages from Flatpak on Debian 12. You can do this using the following command:
You can verify the Flatpak remote repository is successfully added to the Debian using the following command:
After adding repository, search for the Application ID of the package you want to install on Debian through Flatpak using the following syntax:
Here, I am installing discord on Debian 12 from Flatpak so replaced application_name with discord to search for its ID:
After finding the Application ID, you can use that ID to install the application on Debian from flatpak using the below-given command:
You can run the application installed through Flatpak on Debian 12 by using the flatpak run command followed by the Application ID:
To see the list of packages that you install through Flatpak on Debian, you can use the following command:
In case you want to update Flatpak on Debian, simply run the following command that will check for updates and install them automatically on your system:
In case you encounter any issue while working with Flatpak on Debian, you can run the below-given command to fix it:
You can remove a package from Flatpak on Debian 12 using the flatpak remove command with sudo privileges followed by the Application ID, as given below:
Besides using Flatpak to install an application, you can also use it to build an application on your Debian system, this can be done using following steps:
Step 1: Install Runtime and Matching SDK
For building a Flatpak application, you should install a runtime and a matching SDK from the following command, as they will be used to build apps at run time:
Step 2: Install Flatpak Builder on Debian
You must also require installing Flatpak builder on your Debian system that is used for building the packages, it can be installed from the following command:
You should also install the flatpak-builder package from Flatpak as well using the following command:
Step 3: Create a Script
Here, as an example, I am creating a simple script hello.sh that will run as an app and display the value on the terminal.
To create a script on Debian 12, you can use the following command:
Inside the script, I have added the following lines:
echo "Hello Linux Hint Users"
Then save the script using CTRL+X, add Y and press Enter to exit.
Step 4: Add Manifest to an App
You should also require adding a manifest to the app you are going to create; this can be done by adding the following information in an empty file. This manifest file provides the basic information about your application and some instructions on how to use the application for building process.
- name: hello
- install -D hello.sh /app/bin/hello.sh
- type: file
Note: Don’t forget to save the file. Further, you can modify the script according to your needs and application name.
Step 5: Build the Application
After creating the manifest file, you can build it using the flatpak-builder command followed by the target directory and the manifest file name:
Step 6: Run the Application
You can now run the application using the flatpak run command followed by the application name you have created:
This ensures that we have successfully build an application on Debian 12 from Flatpak.
Flatpak is a useful package manager that can be installed on Debian 12 from the system repository. You can use this package manager to install applications on your system and they will run flawlessly without any compatibility issues. This guide has provided a brief overview of how you can install Flatpak on Debian 12 and use it to install and run applications on your system. You will also find a guide on how you can list and remove packages from Flatpak in case you don’t need them. Besides that, you will also learn building your first Flatpak application on your Debian system from this guide.