HomeLinuxSet up and Use Flatpak on Ubuntu

Set up and Use Flatpak on Ubuntu


The Linux world has three ‘common’ packaging codecs that permit working on ‘any’ Linux distribution; Snap, Flatpak and AppImage.

Ubuntu comes baked-in with Snap however most distributions and builders keep away from it due to its shut supply nature. They like Fedora’s Flatpak packaging system.

As an Ubuntu person, you aren’t restricted to Snap. You can also use Flatpak in your Ubuntu system.

On this tutorial, I am going to talk about the next:

  • Enabling Flatpak assist on Ubuntu
  • Utilizing Flatpak instructions to handle packages
  • Getting packages from Flathub
  • Add Flatpak packages to Software program Heart

Sounds thrilling? Let’s have a look at them one after the other.

Putting in Flatpak on Ubuntu

You possibly can simply set up Flatpak utilizing the next command:

sudo apt set up flatpak

For Ubuntu 18.04 or older variations, use PPA:

sudo add-apt-repository ppa:flatpak/secure
sudo apt replace
sudo apt set up flatpak

Add Flathub repo

You may have put in Flatpak assist in your Ubuntu system. Nonetheless, for those who attempt to set up a Flatpak bundle, you will get ‘No distant refs discovered’ error. That is as a result of there are not any Flatpak repositories added and therefore Flatpak would not even know from the place it ought to get the purposes.

Flatpak has a centralized repository known as Flathub. A lot of Flatpak purposes might be discovered and downloaded from right here.

It’s best to add the Flathub repo to entry these purposes.

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Install Flatpak in latest versions of Ubuntu and then add Flathub repo
Putting in Flatpak and add Flathub Repo

As soon as Flatpak is put in and configured, restart your system. In any other case, put in Flatpak apps will not be seen in your system menu.

Nonetheless, you may all the time run a flatpak app by working:

flatpak run <package-name>

Frequent Flatpak Instructions

Now that you’ve Flatpak packaging assist put in, it is time to study among the most typical Flatpak instructions wanted for bundle administration.

Seek for a Package deal

Both use Flathub web site or use the next command, if you understand the appliance identify:

flatpak search <package-name>
Search for a package using Flatpak Search command
Seek for a Package deal

🚧

Aside from looking a flatpak bundle, on different cases, the <package-name> refers back to the correct Flatpak bundle identify, like com.raggesilver.BlackBox (Software ID within the above screenshot). You may additionally use the final phrase Blackbox of the Software ID.

Set up a Flatpak bundle

This is the syntax for putting in a Flatpak bundle:

flatpak set up <remote-repo> <package-name>

Since virtually all of the instances you will be getting purposes from Flathub, the distant repository will probably be flathub:

flatpak set up flathub <package-name>
Install a package after searching for its name
Set up a Package deal

In some uncommon instances, you might set up Flatpak packages from the developer’s repository immediately as an alternative of Flathub. In that case, you utilize a syntax like this:

flatpak set up --from https://flathub.org/repo/appstream/com.spotify.Consumer.flatpakref

Set up a bundle from flatpakref

That is elective and uncommon too. However someday, you’re going to get a .flatpakref file for an utility. That is NOT an offline set up. The .flatpakref has the required particulars about the place to get the packages.

To put in from such a file, open a terminal and run:

flatpak set up <path-to-flatpakref file>
Install a Flatpak package from Flatpakref file
Set up Flatpakref

Run a Flatpak utility from the terminal

Once more, one thing you will not be doing it typically. Principally, you will seek for the putting in utility within the system menu and run the appliance from there.

Nonetheless, you may as well run them from the terminal utilizing:

flatpak run <package-name>

Record put in Flatpak packages

Need to see which Flatpak purposes are put in in your system? Record them like this:

flatpak record
List all the installed Flatpak packages on your system
Record Put in Packages

Uninstall a Flatpak bundle

You possibly can take away an put in Flatpak bundle within the following method:

flatpak uninstall <package-name>

If you wish to clear the leftover packages and runtimes, which can be now not wanted, use:

flatpak uninstall --unused
Remove a Flatpak package and later, if there is any unused runtimes or packages, remove them
Take away a bundle

It might enable you to avoid wasting disk area on Ubuntu.

Flatpak instructions abstract

This is a fast abstract of the instructions you discovered above:

Utilization Command
Seek for Packages flatpak search
Set up a Package deal flatpak set up
Record Put in Package deal flatpak record
Set up from flatpakref flatpak set up <package-name.flatpakref>
Uninstall a Package deal flatpak uninstall
Uninstall Unused runtimes and packages flatpak uninstall –unused

Utilizing Flathub to discover Flatpak packages

I perceive that trying to find Flatpak packages by the command line will not be the perfect expertise and that is the place the Flathub web site comes into image.

You possibly can browse the Flatpak utility on Flathub, which gives extra particulars like verified publishers, whole variety of downloads and many others.

You may additionally get the instructions you should use for putting in the purposes on the backside of the appliance web page.

Bonus: Use Software program Heart with Flatpak bundle assist

You possibly can add the Flatpak packages to the GNOME Software program Heart utility and use it for putting in packages graphically.

There’s a devoted plugin so as to add Flatpak to GNOME Software program Heart.

🚧

Since Ubuntu 20.04, the default software program middle in Ubuntu is Snap Retailer and it doesn’t assist flatpak integration. So, putting in the beneath bundle will lead to two software program facilities concurrently: one Snap and one other DEB.

When you install GNOME Software Flatpak plugin in Ubuntu, a DEB version of GNOME Software is installed. So you will have two software center application
Two Software program Heart in Ubuntu
sudo apt set up gnome-software-plugin-flatpak
Installing GNOME Software Plugin in Ubuntu
Set up GNOME Plugin

Conclusion

You discovered loads of issues right here. You discovered to allow Flatpak assist in Ubuntu and handle Flatpak packages by the command line. You additionally discovered concerning the integration with the Software program Heart.

I hope you are feeling a bit extra snug with Flatpaks now. Because you found one of many three common packages, how about studying about Appimages?

Learn how to Use AppImage in Linux [Complete Guide]

What’s AppImage? Learn how to run it? How does it work? Right here’s the entire information about utilizing AppImage in Linux.

Let me know you probably have questions or for those who face any points.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments