{"id":24311,"date":"2018-06-08T14:03:54","date_gmt":"2018-06-08T14:03:54","guid":{"rendered":"http:\/\/www.sickgaming.net\/blog\/2018\/06\/08\/how-to-install-and-use-flatpak-on-linux\/"},"modified":"2018-06-08T14:03:54","modified_gmt":"2018-06-08T14:03:54","slug":"how-to-install-and-use-flatpak-on-linux","status":"publish","type":"post","link":"https:\/\/sickgaming.net\/blog\/2018\/06\/08\/how-to-install-and-use-flatpak-on-linux\/","title":{"rendered":"How to Install and Use Flatpak on Linux"},"content":{"rendered":"<div><img decoding=\"async\" src=\"http:\/\/www.sickgaming.net\/blog\/wp-content\/uploads\/2018\/06\/how-to-install-and-use-flatpak-on-linux.jpg\" class=\"ff-og-image-inserted\" \/><\/div>\n<p>The landscape of applications is quickly changing. Many platforms are migrating to containerized applications\u2026 and with good cause. An application wrapped in a bundled container is easier to install, includes all the necessary dependencies, doesn\u2019t directly affect the hosting platform libraries, automatically updates (in some cases), and (in most cases) is more secure than a standard application. Another benefit of these containerized applications is that they are universal (i.e., such an application would install on Ubuntu Linux or Fedora Linux, without having to convert a .deb package to an .rpm).<\/p>\n<p>As of now, there are two main universal package systems: <a href=\"https:\/\/www.linux.com\/learn\/intro-to-linux\/2018\/5\/get-started-snap-packages-linux\">Snap<\/a> and Flatpak. Both function in similar fashion, but one is found by default on Ubuntu-based systems (Snap) and one on Fedora-based systems (Flatpak). It should come as no surprise that both can be installed on either type of system. So if you want to run Snaps on Fedora, you can. If you want to run Flatpak on Ubuntu, you can.<\/p>\n<p>I will walk you through the process of installing and using Flatpak on <a href=\"http:\/\/releases.ubuntu.com\/18.04\/\">Ubuntu 18.04<\/a>. If your platform of choice is Fedora (or a Fedora derivative), you can skip the installation process.<\/p>\n<h3>Installation<\/h3>\n<p>The first thing to do is install Flatpak. The process is simple. Open up a terminal window and follow these steps:<\/p>\n<ol>\n<li>\n<p>Add the necessary repository with the command <em>sudo add-apt-repository ppa:alexlarsson\/flatpak<\/em>.<\/p>\n<\/li>\n<li>\n<p>Update apt with the command <em>sudo apt update<\/em>.<\/p>\n<\/li>\n<li>\n<p>Install Flatpak with the command<em> <\/em><em>sudo apt install flatpak<\/em>.<\/p>\n<\/li>\n<li>\n<p>Install Flatpak support for GNOME Software with the command <em>sudo apt install gnome-software-plugin-flatpak<\/em>.<\/p>\n<\/li>\n<li>\n<p>Reboot your system.<\/p>\n<\/li>\n<\/ol>\n<h3>Usage<\/h3>\n<p>I\u2019ll first show you how to install a Flatpak package from the command line, and then via the GUI. Let\u2019s say you want to install the Spotify desktop client via Flatpak. To do this, you must first instruct Flatpak to retrieve the necessary app. The Spotify Flatpak (along with others) is hosted on <a href=\"https:\/\/flathub.org\/\">Flathub<\/a>. The first thing we\u2019re going to do is add the Flathub remote repository with the following command:<\/p>\n<pre>\nsudo flatpak remote-add --if-not-exists flathub https:\/\/flathub.org\/repo\/flathub.flatpakrepo<\/pre>\n<p>Now you can install any Flatpak app found on Flathub. For example, to install <a href=\"https:\/\/flathub.org\/apps\/details\/com.spotify.Client\">Spotify<\/a>, the command would be:<\/p>\n<pre>\nsudo flatpak install flathub com.spotify.Client<\/pre>\n<p>To find out the exact command for each install, you only have to visit the app\u2019s page on Flathub and the installation command is listed beneath the description. <\/p>\n<p>Running a Flatpak-installed app is a bit different than a standard app (at least from the command line). Head back to the terminal window and issue the command:<\/p>\n<pre>\nflatpak run com.spotify.Client<\/pre>\n<p>Of course, after you\u2019ve re-started your machine (upon installing the GNOME Software Support), those apps should appear in your desktop menu, making it unnecessary to start them from the command line.<\/p>\n<p>To uninstall a Flatpak from the command line, you would go back to the terminal and issue the command:<\/p>\n<pre>\nsudo flatpak uninstall NAME<\/pre>\n<p>where NAME is the name of the app to remove. In our Spotify case, that would be:<\/p>\n<pre>\nsudo flatpak uninstall com.spotify.Client\n<\/pre>\n<p>Now we want to update our Flatpak apps. To do this, first list all of your installed Flatpak apps by issuing the command:<\/p>\n<pre>\nflatpak list<\/pre>\n<p>Now that we have our list of apps (Figure 1), we can update with the command <em>sudo flatpak update NAME<\/em> (where NAME is the name of our app to update).<\/p>\n<p>So if we want to update GIMP, we\u2019d issue the command:<\/p>\n<pre>\nsudo flatpak update org.gimp.GIMP<\/pre>\n<p>If there are any updates to be applied, they\u2019\u2019ll be taken care of. If there are no updates to be applied, nothing will be reported.<\/p>\n<h3>Installing from GNOME Software<\/h3>\n<p>Let\u2019s make this even easier. Since we installed GNOME Software support for flatpak, we don\u2019t actually have to bother with the command line. Don\u2019t be mistaken, unlike Snap support, you won\u2019t actually find Flatpak apps listed within GNOME Software (even though we\u2019ve installed Software support). Instead, you\u2019ll find support through the web browser. <\/p>\n<p>Let me show you. Point your browser to <a href=\"https:\/\/flathub.org\/\">Flathub<\/a>. <\/p>\n<p>Let\u2019s say you want to install Slack via Flatpak. Go to the <a href=\"https:\/\/flathub.org\/apps\/details\/com.slack.Slack\">Slack Flathub<\/a> page and then click on the INSTALL button. Since we installed GNOME Software support, the standard browser dialog window will appear with an included option to open the file via Software Install (Figure 2).<\/p>\n<p>This action will then open GNOME Software (or, in the case of Ubuntu, Ubuntu Software), where you can click the Install button (Figure 3) to complete the process.<\/p>\n<p>Once the installation completes, you can then either click the Launch button, or close GNOME Software and launch the application from the desktop menu (in the case of GNOME, the Dash).<\/p>\n<p>After you\u2019ve installed a Flatpak app via GNOME Software, it can also be removed from the same system (so there\u2019s still not need to go through the command line). <\/p>\n<h3>What about KDE?<\/h3>\n<p>If you prefer using the KDE desktop environment, you\u2019re in luck. If you issue the command sudo apt install plasma-discover-flatpak-backend, it\u2019ll install Flatpak support for the KDE app store, Discover. Once you\u2019ve added Flatpak support, you then need to add a repository. Open Discover and then click on Settings. In the settings window, you\u2019ll now see a Flatpak listing (Figure 4). <\/p>\n<p>Click on the Flatpak drop-down and then click Add Flathub. Click on the Applications tab (in the left navigation) and you can then search for (and install) any applications found on Flathub (Figure 5).<\/p>\n<h3>Easy Flatpak management<\/h3>\n<p>And that\u2019s the gist of using Flatpak. These universal packages can be used on most Linux distributions and can even be managed via the GUI on some desktop environments. I highly recommend you give Flatpak a try. With the combination of standard installation, Flatpak, and Snaps, you\u2019ll find software management on Linux has become incredibly easy.<\/p>\n<p><em>Learn more about Linux through the free\u00a0<a href=\"https:\/\/training.linuxfoundation.org\/linux-courses\/system-administration-training\/introduction-to-linux\">&#8220;Introduction to Linux&#8221;\u00a0<\/a>course from The Linux Foundation and edX.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The landscape of applications is quickly changing. Many platforms are migrating to containerized applications\u2026 and with good cause. An application wrapped in a bundled container is easier to install, includes all the necessary dependencies, doesn\u2019t directly affect the hosting platform libraries, automatically updates (in some cases), and (in most cases) is more secure than a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":24312,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[],"class_list":["post-24311","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-freebsd-unix"],"_links":{"self":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/24311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/comments?post=24311"}],"version-history":[{"count":0,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/posts\/24311\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media\/24312"}],"wp:attachment":[{"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/media?parent=24311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/categories?post=24311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sickgaming.net\/blog\/wp-json\/wp\/v2\/tags?post=24311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}