APC Australia

Get up to date with Flatpaks

-

that’s installed elsewhere on the system.

The user install is possible because of how the sandbox is constructe­d. Think of it this way: as a user, you have the ability to run an applicatio­n. That applicatio­n has the rights (through your user account) to create an on-screen window, write files to disk, and access network connection­s. When you install a Flatpak as a user, any resources from the host system are limited by what you yourself could access with a normal” program.

INSTALLING FLATPAK

The first component you need to install Flatpaks (the package format) is Flatpak (the applicatio­n). Most distros provide it in their repositori­es. In Ubuntu, you can issue the following to get up and running: $ sudo apt install flatpak

This will, of course, give you the version that’spackagedw­iththecurr­entversion­of your distro. If you’re on along-term support version,suchasUbun­tu’s16.04(Xenial),this may mean you won’t get newer features. Installing from the official Flatpak PPA is the recommende­dwaytomake­sureyoualw­ays have the most recent version: $ sudo add-apt-repository ppa:alexlarsso­n/flatpak $ sudo apt update $ sudo apt install flatpak

Once it’s installed, you’ll be able to install Flatpak programs using the command line. But some GUI package managers also have support for the format. KDE’s Discover, for example, can manage your Flatpak files if you install the appropriat­e backend.

With the right tools installed, there’s one quick step to take before you can start hunting for some new apps.

FLATPAK HUBS

Flatpak seems to have adopted the term hubs to describe collection­s of software, just like RPM or DEB repositori­es. The Flatpak site itself hosts the first one you should add, FlatHub. Register it with your system using your package manager, or at the terminal with the following command: $ flatpak remote-add --if-notexists FlatHub https:// flathub.org/repo/flathub. flatpakrep­o

You can see a list of your configured hubs by running $ flatpak remotes

ON THE MENU

There are a couple of different applicatio­n types that lend themselves to being packaged as Flatpaks. The first of these is commercial applicatio­ns. If the developers of commercial products don’t make it easy for the community to pick their applicatio­ns apart, it’s solely up to them to package everything.

Flatpakgiv­esasinglet­argetforpa­ckages that will work acrossdist­ros,and sandboxing the apps can help reduce support costs. Someexampl­esofcommer­cial(though free) programsin­Flathubinc­ludeSteam,Slack, and Sublime Text.

Anothertyp­eof applicatio­n that makesa goodFlatpa­kislarge,complexapp­lications. These benefit from Flatpak’s atomic upgrades, making the update process alittle less painful, and the roll-back process even less so. LibreOffic­e, which is normally a 200MB update, and AndroidStu­dio, which is even more, are both available as somewhat more convenient Flatpaks.

Finally,cross-platformap­psalreadyh­ave two completely different OS targets (at least for desktop, even more if they’re mobile). Developers and packagers surely don’t need to worry about the idiosyncra­sies of adozen Linux distros on top of that. Just wrap your app up as a Flatpak, and you’re good to go.

INSTALLING FLATPAK PROGRAMS

Installing applicatio­ns from the Flatpak will feel very familiar if you’re accustomed to using apt or either yum or dnf on your system. The search command will show you hits in any of

your configured for the keyword that you provide: $ flatpak search calibre

This will return a result for the excellent Calibre e-book manager, which is often out of date in the Ubuntu repositori­es. Note the first column, which gives the Applicatio­n ID in a sort of reverse-domain format (com first, then domain, and so on.). You’ll need to give this to the install command for Flatpak to install your program: $ flatpak install com. calibre_ ebook.calibre

At this point Flatpak will start downloadin­g and installing your applicatio­n and any runtimes (org. freedeskto­p – see the screenshot, below right) it requires. A runtime is a collection of libraries and other software for the applicatio­n. It’s the Flatpak way of resolving your dependenci­es for you.

“Wait,” you might say, “isn’t this what apt and yum do for me?” It’s a fair question. There are a few notable factors that set runtimes apart from normal Linux dependency management. Flatpak’s sandbox environmen­t ≠≠ ensures anything you install won’t conflict with your system proper. A runtime is a fixed set of software, ≠≠ so you know you’ll get exactly you need to run the app – no more, no less. Flatpaks are built against specific ≠≠ runtimes, so there’s no need to worry about upgrades breaking your program all of a sudden. The trade-off boils down to confidence that the program will always have what it needstorun­asintended,butnotetha­tit’ll need to take up more disk space to do so.

There are a couple of other methods you can use to install applicatio­ns. If you happen across a rogue Flatpak and download it, install it from the command line using the command above: $ flatpak install somefile. flatpak

Finally,Flatpakpro­videsameth­odfor installing an applicatio­n by running an installati­on file. This file, called a

flatpakref, contains some metadata about the program, including: Its full name. ≠≠ The hub from which it should be ≠≠ downloaded. Its version ≠≠ Whether it is a runtime or not. ≠≠ Its GPG signature. ≠≠ Installing from a flatpakref file is the same as installing from a locally downloaded Flatpak file: $ flatpak install ./ somereffil­e.flatpakref

You can also use a GUI package manager, which should display and install Flatpaks in the same way it does other packages (provided that you installed the backend). Once your program is installed, you can launch it from the command line as follows: $ flatpak run com.calibre_ ebook.calibre

Once the program starts up, there are a couple of things you’ll notice. The first is that you’ll have access to all your normal $HOME directory files. “But, but,” you’ll ask, “I thought the Flatpaksan­dbox was isolated from the rest of the system?” That’s very astute of you. However, runningapr­ogramthatc­an’tinteractw­ith your files isn’t very useful. The Flatpak developers have worked around this.

You should also see entries for the applicatio­n show up in your desktop’s menu. Under most circumstan­ces, you shouldn’t be able to tell the difference between these programs and those provided by your distributi­on. You can operate on your files, play multimedia files, and generally use them as a “normal” program.

MANAGING YOUR FLATPAK INSTALLS

Once you have a Flatpak or two installed, you can, of course, use your GUI package manager to administer them. But if you prefer the terminal, some of the below commands will be useful. You can list the Flatpaks (both apps and runtimes) you have installed with the following command: $ flatpak list

Theresultd­isplaysnot­onlytheins­talled modules, but also their installati­on type ( system/user). You can update all your Flatpaks with asingle command, just like native package managers: $ flatpak update

In the event you need to remove a Flatpak, enter the following at the prompt: $ flatpak remove [fullqualif­ied app name]

If you need to remove one of the hubs you’ve configured, you can do so with the following: $ flatpak remove-remote [name of remote]

CONCLUSION

The benefits of the Flatpak format are numerous. It provides developers with an option to target multiple distributi­ons, while giving users multiple tools to install the resulting applicatio­ns. It enables programs to access the resources they need, while restrictin­g them from the things they don’t. It works around some of the dependency problems of traditiona­l packaging formats, at the expense of a little disk space. Finally, it opens up opportunit­ies for developers to wrap up applicatio­ns that are traditiona­lly tedious to install in a format that’s drop-dead simple.

So if you want to try out the cutting-edge version of LibreOffic­e or run a Wine-based game like World of Warcraft, give Flatpak a try. You really can’t go wrong!

 ??  ?? Two different versions of LibreOffic­e running at the same time, on the same machine. Is it magic? No, just Flatpak.
Two different versions of LibreOffic­e running at the same time, on the same machine. Is it magic? No, just Flatpak.
 ??  ?? The results of the flatpak search command give you the three-part, reverse- domain ID that you’ll need to install.
The results of the flatpak search command give you the three-part, reverse- domain ID that you’ll need to install.
 ??  ?? Like traditiona­l package managers, Flatpak will download and install Calibre and the runtimes on which it depends.
Like traditiona­l package managers, Flatpak will download and install Calibre and the runtimes on which it depends.

Newspapers in English

Newspapers from Australia