In this guide, we will show you how to install Flatpak on Ubuntu using terminal. We will also describe how to manage Flatpak applications, and show you some additional useful examples.
Flatpak is a popular package manager that allows users to install and run applications on various Linux distributions. It is an excellent alternative to traditional package managers like apt, as it provides a sandboxed environment for applications and ensures that they run smoothly without interfering with the operating system.
Table of Contents
Why Choose Flatpak?
Unlike traditional package managers, Flatpak uses a decentralized approach, with individual repositories for each package. This approach offers several advantages, including greater flexibility and independence from centralized parties.
One of the key benefits of Flatpak is its ability to handle dependencies and libraries required for software installation. This means that you no longer need to worry about compatibility issues or tracking down missing dependencies manually. Flatpak takes care of everything for you, making the installation process much smoother and more efficient.
Install and Use Flatpak on Ubuntu
Step 1: install Flatpak on Ubuntu via the command line
The first step to using Flatpak on Ubuntu is to install it. Thankfully, this is a straightforward process that can be done using below command in the terminal:
sudo apt install flatpak
This command will install Flatpak on Ubuntu along with the necessary dependencies.
Once the installation is complete, you can check the version of Flatpak by entering the below command:
flatpak --version
Step 2: Adding the Flatpak Repository
To access a wide range of Flatpak applications, you need to add the Flathub repository. The Flathub repository is the central hub for Flatpak applications and offers an extensive collection of software.
To add the Flathub repository, use the following command:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
This command ensures that the Flathub repository is added to your system. With Flathub enabled, you can now search for and install Flatpak applications directly from the repository.
Step 3: Install Flatpak apps in terminal
Once Flatpak is installed, you can start installing applications using command:
flatpak install <application name>
For example, to install the Telegram application, you would use command:
flatpak install telegram
This will download and install the Telegram application on your system. During the installation process, you may be presented with multiple options for the application. Choose the appropriate option by entering the corresponding number.
You can repeat this process to install any other Flatpak packages that you need.
Install Flatpak apps using the Graphical Method via Browser
If you prefer a more user-friendly approach, you can install Flatpak applications directly from your browser. Simply visit the Flathub website (https://flathub.org/home) and browse the available applications. Click on the desired application and select the “Install” button.
The browser will prompt you to open the installation link with Flatpak. Confirm the action, and Flatpak will handle the installation process in the background.
By integrating Flatpak with the Ubuntu Software Center, you can enjoy a graphical interface for managing and installing Flatpak applications. Open a terminal and run command to install the software Flatpak plugin for the Ubuntu Software Center:
sudo apt install gnome-software-plugin-flatpak
This plugin enables the Ubuntu Software Center to recognize and handle Flatpak applications. To complete the setup, it is recommended to restart your Ubuntu system.
Once installed, you can launch the Ubuntu Software Center and search for Flatpak applications.
Managing Flatpak Applications
Now that you have installed Flatpak and some applications, you can start using them. To launch a Flatpak application, you can either search for it in the application launcher or use a command in the terminal.
flatpak run <application name>
For example, to launch Telegram application, you would use command:
flatpak run telegram
This will launch Telegram in a sandboxed environment and ensure that it runs smoothly without interfering with your Ubuntu OS.
To list all installed applications, use the following command:
flatpak list
This command will display a list of all installed applications along with their respective application IDs.
To get more information about a Flatpak app, you can use command:
flatpak info <package-name>
To update a specific application, use the following command:
flatpak update <application_ID>
Replace <application_ID> with the ID of the application you want to update. Alternatively, you can use command to update all installed applications.
flatpak update --all
If you no longer need a specific application, you can uninstall it using the command:
flatpak uninstall <application_ID>
Replace <application_ID> with the ID of the application you want to uninstall.
Flatpak uninstall
To uninstall Flatpak on Ubuntu, you can use the terminal command “sudo apt remove flatpak
“. This will remove all Flatpak packages and dependencies from your system. Additionally, you may want to use the command “sudo apt autoremove
” to remove any leftover dependencies that are no longer needed. Once complete, Flatpak will be completely removed from your Ubuntu system.
Where is Flatpak installed Ubuntu?
Flatpak is installed in the following directories on Ubuntu:
- The system-wide data for Flatpak, including runtimes, applications, and configuration, is located in
/var/lib/flatpak/
- The per-user data for Flatpak is located in
~/.local/share/flatpak/
These directories contain the necessary files and information related to Flatpak installations on Ubuntu.
You can find out more about the location of Flatpak files on Ubuntu by running the following command:
flatpak info
This command will print a summary of the Flatpak installation, including the location of the runtimes, applications, and configuration files.
Should I install Flatpak or use Snap?
Both formats have their advantages and disadvantages, and the choice between them depends on the user’s needs and preferences. Flatpak is installed by default on modern Linux distros, while Snap is preferred mainly by Canonical’s Ubuntu and its official flavors. Flatpak packages take up more space than Snaps, but they offer more control to developers. Flatpak is generally considered faster than Snap. One must keep in mind that the following are only general patterns and there could be deviations. Certain programs may perform better as a Snap, while others may perform better as a Flatpak. In any case, you can install Flatpak on Ubuntu and try out Flatpak applications.
Conclusion
In this blog post, we have demonstrated how to install Flatpak on Ubuntu and how to manage Flatpak applications. Installing Flatpak on Ubuntu opens up a world of possibilities, allowing you to easily access and manage a wide range of applications. With Flatpak’s centralized repository and handling of dependencies, installing software on Linux has never been easier. Flatpak, an innovative software deployment tool, streamlines the installation process, providing a seamless experience for Ubuntu users. By leveraging Flatpak’s robust ecosystem, you gain access to an extensive library of applications, spanning various categories, including productivity, communication, and entertainment. Furthermore, by utilizing Flatpak’s efficient dependency handling, you can ensure smooth installation and compatibility across different Linux distributions.