Install and Use Flatpak on Rocky Linux 8: Easy Package Installer

Posted on

Install and Use Flatpak on Rocky Linux 8: Easy Package Installer

Install and Use Flatpak on Rocky Linux 8: Easy Package Installer

This tutorial is designed to guide you through the process of Install and Use Flatpak on Rocky Linux 8. Flatpak represents a modern approach to application distribution within the Linux ecosystem, offering a solution that transcends specific distributions. This framework for cross-distribution application deployment empowers developers to create Flatpak packages compatible with a wide range of major Linux distributions.

One of the primary challenges in Linux application distribution is dependency management, and Flatpak effectively addresses this issue. Flatpak packages bundle all necessary dependencies for each application, eliminating the need for end-users to manually handle dependency resolution.

With a simple setup on your distribution, you’ll be prepared to explore the expansive world of Flatpak applications on Install and Use Flatpak on Rocky Linux 8.

To successfully follow this guide, ensure you are logged into your server as a non-root user with sudo privileges. You can refer to a guide on Initial Server Setup with Rocky Linux 8 for assistance with this step.

Flatpak Installation on Rocky Linux 8

Flatpak packages are readily available in the default Rocky Linux 8 repository. Begin by updating your local package index and then install Flatpak using the following commands:

# sudo dnf update -y
# sudo dnf install flatpak -y

Next, verify the installation of Flatpak by checking its version:

flatpak --version
**Output**
Flatpak 1.10.7

Using Flatpak Rocky Linux 8

The following examples demonstrate how to effectively use the Flatpak package manager.

Enable Flathub on Rocky Linux 8

Before you can start using Flatpak, you need to enable Flathub. Flathub serves as a central repository for obtaining and distributing applications for all desktop Linux environments. Powered by Flatpak, Flathub apps can run on virtually any Linux distribution.

To enable Flathub, use the following command:

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

Search Apps with Flatpak

To search for a specific application, use the following syntax:

flatpak search <Application_name>

For example, to search for OpenJDK, use:

flatpak search openjdk
**Output**
Name      Description               Application ID        Version Branch Remotes
OpenJdk ― OpenJdk 8 Sdk extension   ―k.Extension.openjdk8         22.08  flathub
OpenJdk ― OpenJdk 8 Sdk extension   ―k.Extension.openjdk8         21.08  flathub
OpenJdk ― OpenJdk 8 Sdk extension   ―k.Extension.openjdk8         20.08  flathub
OpenJDK ― The LTS (long term suppo― ―.Extension.openjdk17         22.08  flathub
OpenJDK ― The LTS (long term suppo― ―.Extension.openjdk17         21.08  flathub
OpenJDK ― The LTS (long term suppo― ―.Extension.openjdk17         20.08  flathub
OpenJDK ― The LTS (long term suppo― ―.Extension.openjdk11         22.08  flathub
OpenJDK ― The LTS (long term suppo― ―.Extension.openjdk11         21.08  flathub
OpenJDK ― The LTS (long term suppo― ―.Extension.openjdk11         20.08  flathub
OpenJDK ― The LTS (long term suppo― ―.Extension.openjdk11         19.08  flathub
OpenJDK ― The LTS (long term suppo― ―.Extension.openjdk11         18.08  flathub
OpenJDK ― The latest version of th― ―dk.Extension.openjdk         21.08  flathub
OpenJDK ― The latest version of th― ―dk.Extension.openjdk         20.08  flathub
OpenJDK ― The latest version of th― ―dk.Extension.openjdk         19.08  flathub
OpenJDK ― The latest version of th― ―dk.Extension.openjdk         18.08  flathub

Install an App with Flatpak

Once you’ve located the application you want to install, use the following command:

flatpak install <Application_name>

For example:

flatpak install openjdk

The system will then prompt you to select the version you wish to install.

Looking for matches…
Found similar ref(s) for ‘openjdk’ in remote ‘flathub’ (system).
Use this remote? [Y/n]: y
Similar refs found for ‘openjdk’ in remote ‘flathub’ (system):

   1) runtime/org.freedesktop.Sdk.Extension.openjdk8/x86_64/21.08
   2) runtime/org.freedesktop.Sdk.Extension.openjdk10/x86_64/18.08
   3) runtime/org.freedesktop.Sdk.Extension.openjdk/x86_64/18.08
   4) runtime/org.freedesktop.Sdk.Extension.openjdk17/x86_64/20.08
   5) runtime/org.freedesktop.Sdk.Extension.openjdk8/x86_64/22.08
   6) runtime/org.freedesktop.Sdk.Extension.openjdk11/x86_64/18.08
   7) runtime/org.freedesktop.Sdk.Extension.openjdk/x86_64/19.08
   8) runtime/org.freedesktop.Sdk.Extension.openjdk17/x86_64/21.08
   9) runtime/org.freedesktop.Sdk.Extension.openjdk11/x86_64/19.08
  10) runtime/org.freedesktop.Sdk.Extension.openjdk/x86_64/20.08
  11) runtime/org.freedesktop.Sdk.Extension.openjdk17/x86_64/22.08
  12) runtime/org.freedesktop.Sdk.Extension.openjdk11/x86_64/20.08
  13) runtime/org.freedesktop.Sdk.Extension.openjdk/x86_64/21.08
  14) runtime/org.freedesktop.Sdk.Extension.openjdk8/x86_64/18.08
  15) runtime/org.freedesktop.Sdk.Extension.openjdk11/x86_64/21.08
  16) runtime/org.freedesktop.Sdk.Extension.openjdk9/x86_64/18.08
  17) runtime/org.freedesktop.Sdk.Extension.openjdk8/x86_64/19.08
  18) runtime/org.freedesktop.Sdk.Extension.openjdk11/x86_64/22.08
  19) runtime/org.freedesktop.Sdk.Extension.openjdk10/x86_64/1.6
  20) runtime/org.freedesktop.Sdk.Extension.openjdk8/x86_64/1.6
  21) runtime/org.freedesktop.Sdk.Extension.openjdk9/x86_64/1.6
  22) runtime/org.freedesktop.Sdk.Extension.openjdk8/x86_64/20.08

Which do you want to use (0 to abort)? [0-22]: 1

Upon successful completion, you’ll see the following output:

**Output**
        ID                                      Branch Op Remote  Download
 1. [✓] org.freedesktop.Sdk.Extension.openjdk17 22.08  i  flathub 522.4 MB / 495.0 MB

Installing… ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%  27.5 MB/s  00:00

Uninstall Apps with Flatpak

To uninstall an application installed via Flatpak, use the following command:

flatpak uninstall APP-ID

For example:

flatpak uninstall runtime/org.freedesktop.Sdk.Extension.openjdk17

[Image of Uninstall Apps with Flatpak Rocky Linux 8]

For more comprehensive information, refer to the Flatpak Docs.

Uninstall or Remove Flatpak

If you no longer wish to use Flatpak on Rocky Linux 8, you can remove it using the following command:

sudo dnf autoremove flatpak -y

Conclusion

The ease of use is just one aspect of what makes Flatpak appealing. Another significant point is the access to proprietary software.

Flatpak grants access to a wide range of proprietary software. For instance, installing Zoom, Spotify, or other applications using apt or dnf can be challenging (requiring the addition of repositories, which may still cause problems). With Flatpak, a whole new world of software is accessible to Linux users.

Hope you found this guide helpful. You might also be interested in these related articles:

Install Docker Compose on Rocky Linux 8

Clear Yum Cache on Centos 7

Alternative Solutions for Application Installation on Rocky Linux 8

While Flatpak offers a convenient and modern way to install applications on Rocky Linux 8, alternative methods exist. Here are two alternative approaches:

1. Using Snap

Snap is another universal package manager similar to Flatpak. It was developed by Canonical, the company behind Ubuntu. Like Flatpak, Snap packages bundle dependencies, providing application isolation and simplifying installation across different Linux distributions.

Explanation:

Snap provides a self-contained environment for applications, ensuring consistency and preventing conflicts with system libraries. It also offers automatic updates and security features. The Snap store provides a centralized repository for finding and installing applications.

Installation and Usage:

  1. Install Snap:

    sudo dnf install snapd
    sudo systemctl enable --now snapd.socket
    sudo ln -s /var/lib/snapd/snap /snap
  2. Find an Application:

    snap find <application_name>

    For example:

    snap find vlc
  3. Install an Application:

    sudo snap install <application_name>

    For example:

    sudo snap install vlc
  4. Run the Application:

    The application can be run directly from the command line or found in the application menu.

  5. Uninstall an Application:

    sudo snap remove <application_name>

    For example:

    sudo snap remove vlc

2. Using AppImage

AppImage is a format for distributing portable software on Linux without needing superuser permissions to install the application. It is a self-contained package that includes all dependencies needed to run the application.

Explanation:

AppImage files are standalone executables. You simply download the AppImage, make it executable, and run it. There’s no need for installation or dependency management. This approach is particularly useful for distributing applications that are not available in standard repositories or when you want to run a specific version of an application without affecting the system’s package manager.

Installation and Usage:

  1. Download the AppImage:

    Find the AppImage for the desired application from the official website or repository.

  2. Make the AppImage Executable:

    chmod +x <application_name>.AppImage

    For example:

    chmod +x firefox.AppImage
  3. Run the Application:

    ./<application_name>.AppImage

    For example:

    ./firefox.AppImage
  4. Optional: Integrate with the Desktop Environment:

    Tools like appimaged can integrate AppImages with the desktop environment, adding them to the application menu. This typically involves installing appimaged via dnf if it’s available and then running it. The integration process varies depending on the specific tool.

  5. Uninstall:

    To uninstall, simply delete the AppImage file. Since the application is self-contained, removing the file completely removes the application.

These alternative methods, Snap and AppImage, offer different trade-offs in terms of convenience, system integration, and dependency management compared to Flatpak. The best choice depends on your specific needs and preferences. Remember that the key to Install and Use Flatpak on Rocky Linux 8 and other solutions is to find what suits your workflow best.