TranslateProject/sources/tech/20221101.11 ⭐️⭐️ How to Install Flatpak Apps in Ubuntu and Other Linux.md

9.3 KiB
Raw Permalink Blame History

How to Install Flatpak Apps in Ubuntu and Other Linux

A beginners guide on how to install Flatpak in Ubuntu and other Linux distributions.

What is Flatpak?

Flatpak is the new way of distributing apps across the Linux universe, irrespective of the distribution. This cross-distro application distribution and deployment framework enable developers to Flatpak setup for apps for all major distributions.

The major hurdles in any Linux app distribution are dependencies, and Flatpak covers that. Flatpak builds bundles the dependencies for the respective apps, and end-users need not worry about it.

With the growing trends, many app developers are now providing the Flatpak builds along with traditional packages, e.g. *.deb, etc. With a quick setup for your distributions, you can be ready to explore the world of Flatpak apps. All the major Flatpak apps are available on flathub.org. You can search and just click a button, you can install the Flatpak apps. Heres how to set it up for Ubuntu and other Linux distributions.

How to setup Flatpak in Ubuntu

  • For Ubuntu 18.10 (Cosmic Cuttlefish), use the following command to install Flatpak (that includes Ubuntu 22.04 as well).
sudo apt install flatpak

If you are using an older version of Ubuntu, use the following repo.

sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt update
sudo apt install flatpak
  • The second step is optional if you want to install Flatpak apps via the browser. Enable Ubuntu Software to recognize Flatpak apps and their installations. Run the below commands from the terminal and provide the password when prompted.
sudo apt install gnome-software-plugin-flatpak
  • Add the Flathub repository where all the Flatpak apps reside. Run the below commands from the terminal.
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
  • Reboot.

Install in Other Linux Distributions

Flatpak is available to install almost all possible distributions. Heres a quick list of commands you can run from the terminal in all the distros.

Linux distro name Instructions or commands to set up Flatpak
AlmaLinux Enabled by default. No action is required.
Alpine Linux Run the following commands:sudo apk add flatpak``flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]``reboot
Arch Linux Run the following commands:sudo pacman -S flatpak``flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]``reboot
CentOS Enabled by default. No action is required.
Clear Linux Enabled by default. No action is required.
Debian Run the following commands:apt install flatpak``flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]``reboot
Deepin OS Run the following commands:sudo apt install flatpak``flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]``reboot
elementary OS Enabled by default. No action is required.
Endeavour OS Enabled by default. No action is required.
Endless OS Enabled by default. No action is required.
Fedora Linux Flatpak is installed by default. All you need to do is to install the Flathub repo:flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]And finally, reboot your system before installing the Flatpak app.
Gentoo Run the following commands:echo -e 'sys-apps/flatpak ~amd64\nacct-user/flatpak ~amd64\nacct-group/flatpak ~amd64\ndev-util/ostree ~amd64' >> /etc/portage/package.accept_keywords/flatpakemerge sys-apps/flatpak``flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]``reboot
KDE Neon Enabled by default. No action is required.
Kubuntu Run the following commands:sudo apt install flatpak``flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]``sudo apt install plasma-discover-backend-flatpak``reboot
Linux Mint Enabled by default. No action is required.
Mageia Run the following commands:dnf install flatpak``flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]``reboot
Manjaro Linux (Arch-based) Installed by default since Manjaro 20 and higher.Make sure it is enabled in the below navigation:Software Manager > Preferences > Flatpak Tab > Enable Flatpak SupportReboot your system
MX Linux Enabled by default. No action is required.
Nix OS Open /etc/nixos/configuration.nix and add the following:Services.flatpak.enable = true;And then run the followings:sudo nixos-rebuild switch``flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]``reboot
openSUSE Leap and Tumbleweed Flatpak is installed by default. All you need to do is to install the Flathub repo:flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]And finally, reboot your system before installing the Flatpak apps.
Pop OS Enabled by default. No action is required.
Raspberry Pi OS Run the following commands:sudo apt install flatpak``flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]``reboot
Red Hat Enterprise Linux (RHEL) sudo yum install flatpak``flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]``reboot
Solus Run the following commands:sudo eopkg install flatpak xdg-desktop-portal-gtk``flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]``reboot
Void Linux Run the following commands:sudo xbps-install -S flatpak``flatpak remote-add --if-not-exists flathub [https://flathub.org/repo/flathub.flatpakrepo][2]``reboot
Zorin OS Enabled by default. No action is required.

Once installation is completed, and reboot is done, you can proceed with installing some cool Flatpak apps via the below steps.

How to Install Flatpak Apps in Ubuntu and Other Linux

There are two ways you can install Flatpak apps. Firstly via the command line, which I recommend. And second is the browser method.

I recommend using the command line because it is faster and easier.

The sample command to install any Flatpak app is available at the bottom section of the Flathub app page. A sample command is below:

flatpak install org.gimp.GIMP

Change the above “org.gimp.GIMP” for your application. Remember, this is case-sensitive.

Using the graphical method via browser

  • Go to Flathub.
  • Search for any apps you want to install.

  • Click install after selecting your desired app.

Install Flatpak

  • Click Ok when it prompts you to start the installation via Software.

Open Flatpackref via Software

  • The Software will open and wait till the installation finishes.

How to update Flatpak after you install them?

Updating Flatpak is super easy via the terminal. For example, if you want to update the above GIMP package, you need to run the below command.

flatpak update org.gimp.GIMP

So, this will update a single package. Replace your packages name (i.e. Application ID) for your use case. If you dont know the Application ID, run the command flatpak list from the terminal, and you will find it.

If you want to update ALL the Flatpak packages in your system, simply run the following:

flatpak update

How to uninstall a Flatpak?

You can uninstall a package using the following command. Make sure to change the Application ID for your use case. You can find out the Application ID from the command flatpak list.

flatpak remove org.gimp.GIMP

Closing Notes

In this tutorial, I have explained how you can easily set up Flatpak and install apps from Flathub. Moreover, Flatpak applications are a great way to install and manage them easily. In my opinion, Flatpak will eventually dominate Snap and AppImage in the future.

You may want to check out our other articles about Flatpak, which include how to manage permission, various Flatpak commands and more.


via: https://www.debugpoint.com/how-to-install-flatpak-apps-ubuntu-linux/

作者:Arindam 选题:lkxed 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出