I’ve been meaning to write some sort of easy-to-follow ‘Flatpak How To‘ article for a while. As the technology jostles with Snappy, and we regularly feature Snap apps, it feels only fair.
The reason for the delay is I’ve been waiting for a suitable ‘test’ app to get Flatpak’d up, so when I heard about Jan Horak’s unofficial Firefox Nightly Flatpak builds — bingo; ideal candidate.
For the purposes of this article I’m going to assume that you already know what Flatpak is (if you don’t, the official website should be able to fill you in nicely).
Install Firefox Nightly Flatpak on Ubuntu 16.04 LTS
Now, before we start, I need to stress that Flatpak won’t always be as complicated as it looks below.
First, Flatpak is available on Ubuntu directly as of 17.04, which means the PPA listed below won’t be required.
Secondly, newer versions of GNOME Software (on which Ubuntu Software is based) support Flatpak repo and ref files. These simplify the process of adding remote repositories and installing applications from them. In fact, they make it as easy as clicking a link on a website to open GNOME Software with a shiny big install button ready to go.
But, for now, things are a little more complicated than that. Certainly not as simple as running
snap install app.
Let’s walk though the process of installing the latest Firefox Nightly build on Ubuntu using Flatpak. The guide that follows is adapted from here and here, and should be simple enough to follow along with.
1. Install Flatpak on Ubuntu
To install Flatpak on Ubuntu 16.04 LTS or Ubuntu 16.10 you need to add the following PPA to your Software Sources. The fastest way to do this is via the Terminal, where you run this command:
sudo add-apt-repository ppa:alexlarsson/flatpak
Next, run this command to update your software sources and install Flatpak:
sudo apt update && sudo apt install flatpak
2. Add The Firefox Nightly Flatpak Repo
With Flatpak installed we can move on to adding the relevant repos and runtimes.
Firefox requires the GNOME runtime, which is available from the GNOME repo.
Older versions of Flatpak required you to add these ‘remotes’ (as they’re called) manually. But it’s now possible for to add the repos that we need by running just command, this one adds the Jan Horak’s unofficial Firefox Nightly Flatpak repo:
flatpak install --from https://firefox-flatpak.mojefedora.cz/org.mozilla.FirefoxNightly.flatpakref
Here’s the neat bit: when you run this command you’ll see a message appear that reads:
This application depends on runtimes from http://sdk.gnome.org/repo. You’ll then have the option to “configure” (add, and enable) this repo.
If you choose to go ahead the GNOME 3.22 runtime will be downloaded and installed first. This isn’t a tiny download, so be prepared to give Flatpak a bit of time to grab it and install it. Once that’s finished up with Flatpak will move on to download and install the latest Firefox Nightly.
After a little pause, everything will be done. Open the Unity Dash (or whatever app launcher you use) and search for/find ‘Firefox Nightly’, and click on it to run (make sure you don’t have an existing Firefox process running when you do this).
If you can’t find an app launcher for it, don’t worry. You can launch it from the Terminal by running
flatpak run org.mozilla.FirefoxNightly
Other Helpful Flatpak Commands
You can update the Firefox Nightly Flatpak by running this command:
flatpak update org.mozilla.FirefoxNightly
You can remove the Firefox Nightly Flatpak by running this command:
flatpak uninstall org.mozilla.FirefoxNightly
If you hit any Flatpak-specific issues with Firefox be sure to file a bug on Github.