How To Install Flatpak on Centos 7

In this guide, you will learn to Install and Use Flatpak on Centos 7. Flatpak is a software package management utility. It is secure and you don’t need to worry about the dependencies and libraries that are needed to install a program or app. With Flatpak you can easily add repositories to find and download apps.

How To Install Flatpak on Centos 7?

To enable Flatpak on Centos 7, you must have access to your server as a non-root user with sudo privileges. To do this, you can follow this guide on Initial Server Setup with Centos 7.

Now follow the steps below to complete this guide.

Step 1 – Enable Flatpak on Centos 7

First, you need to run the system update with the following command:

sudo yum update -y

The Flatpak package is available on the default Centos repository. To install it, simply run the following command:

sudo yum install flatpak -y

Verify your Flatpak installation by checking its version:

flatpak --version
Output
Flatpak 1.0.9

Step 2 – Install Flathub Repository File on Centos 7

Before you start to use your Flatpak package manager, you need to enable Flathub on your Centos 7. Flathub is a platform that is used for searching applications.

To enable Flathub, you can use the following Flatpak command:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Step 3 – How To Search Apps with Flatpak?

Now that you have enabled Flathub, you can easily start using your Flatpak package manager on Centos 7.

To search for an application, you can use the following syntax:

flatpak search <Application_name>

For example, we want to search for OpenJDK:

flatpak search openjdk

In your output, you will see:

Output
Application ID                          Version  Branch Remotes Description     
org.freedesktop.Sdk.Extension.openjdk8           22.08  flathub OpenJdk 8 Sdk extension
org.freedesktop.Sdk.Extension.openjdk8           21.08  flathub OpenJdk 8 Sdk extension
org.freedesktop.Sdk.Extension.openjdk8           20.08  flathub OpenJdk 8 Sdk extension
org.freedesktop.Sdk.Extension.openjdk17          22.08  flathub The LTS (long term support) version of the OpenJDK JRE and JDK
org.freedesktop.Sdk.Extension.openjdk17          21.08  flathub The LTS (long term support) version of the OpenJDK JRE and JDK
org.freedesktop.Sdk.Extension.openjdk17          20.08  flathub The LTS (long term support) version of the OpenJDK JRE and JDK
org.freedesktop.Sdk.Extension.openjdk11          22.08  flathub The LTS (long term support) version of the OpenJDK JRE and JDK
org.freedesktop.Sdk.Extension.openjdk11          21.08  flathub The LTS (long term support) version of the OpenJDK JRE and JDK
org.freedesktop.Sdk.Extension.openjdk11          20.08  flathub The LTS (long term support) version of the OpenJDK JRE and JDK
org.freedesktop.Sdk.Extension.openjdk11          19.08  flathub The LTS (long term support) version of the OpenJDK JRE and JDK
org.freedesktop.Sdk.Extension.openjdk11          18.08  flathub The LTS (long term support) version of the OpenJDK JRE and JDK
org.freedesktop.Sdk.Extension.openjdk   20.0.1+9 22.08  flathub The latest version of the OpenJDK JRE and JDK
org.freedesktop.Sdk.Extension.openjdk            21.08  flathub The latest version of the OpenJDK JRE and JDK
org.freedesktop.Sdk.Extension.openjdk            20.08  flathub The latest version of the OpenJDK JRE and JDK
org.freedesktop.Sdk.Extension.openjdk            19.08  flathub The latest version of the OpenJDK JRE and JDK
org.freedesktop.Sdk.Extension.openjdk            18.08  flathub The latest version of the OpenJDK JRE and JDK

Step 4 – How To Install an App with Flatpak?

When searching for your App is completed, you can easily install your desired application by using the following syntax:

flatpak install flathub <Application_ID>

For example, install OpenJDK 17 with Flatpak:

flatpak install flathub org.freedesktop.Sdk.Extension.openjdk17//22.08

It will ask you to Do you want to install it? Press y to continue.

Then, wait for your download process to complete.

When your installation is completed, you will get the following output:

Output
...
Installing: org.freedesktop.Sdk.Extension.openjdk17/x86_64/22.08 from flathub
[####################] 196 metadata, 2330 content objects fetched; 482898 KiB transferred in 23
Now at 4a2b0f460f13.

Step 5 – How To Uninstall an App with Flatpak?

To uninstall an App with Flatpak, you can use the following syntax:

flatpak uninstall APP-ID

For example:

flatpak uninstall org.freedesktop.Sdk.Extension.openjdk17//22.08
Output
Uninstalling from system:
org.freedesktop.Sdk.Extension.openjdk17/x86_64/22.08
Is this ok [y/n]: y
Uninstalling: org.freedesktop.Sdk.Extension.openjdk17/x86_64/22.08

For more information, you can visit the Flatpak Docs page.

Step 6 – How To Uninstall Flatpak From Centos 7?

If you no longer want to use Flatpak, you can easily remove it with the command below:

sudo yum autoremove flatpak -y

Conclusion

At this point, you have learned to install the Flatpak package manager on your Centos 7. Also, you have learned to enable the Flathub repository so that you can use your Flatpak package manager. As you can see in the guide, you can easily search for your app and install it on your server without needing to install dependencies.

Hope you enjoy it. You may be like these articles too:

Disable systemd-resolved on Centos 7

Install PowerDNS and PowerAdmin on Centos 7

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!