Get up to date with Flat­paks

APC Australia - - Contents -

that’s in­stalled else­where on the sys­tem.

The user in­stall is pos­si­ble be­cause of how the sand­box is con­structed. Think of it this way: as a user, you have the abil­ity to run an ap­pli­ca­tion. That ap­pli­ca­tion has the rights (through your user ac­count) to cre­ate an on-screen win­dow, write files to disk, and ac­cess net­work con­nec­tions. When you in­stall a Flat­pak as a user, any re­sources from the host sys­tem are lim­ited by what you your­self could ac­cess with a nor­mal” pro­gram.


The first com­po­nent you need to in­stall Flat­paks (the pack­age for­mat) is Flat­pak (the ap­pli­ca­tion). Most dis­tros pro­vide it in their repos­i­to­ries. In Ubuntu, you can is­sue the fol­low­ing to get up and run­ning: $ sudo apt in­stall flat­pak

This will, of course, give you the ver­sion that’spack­aged­with­the­cur­rentver­sionof your dis­tro. If you’re on along-term sup­port ver­sion,suchasUbuntu’s16.04(Xe­nial),this may mean you won’t get newer fea­tures. In­stalling from the of­fi­cial Flat­pak PPA is the rec­om­mend­ed­way­tomakesurey­oual­ways have the most re­cent ver­sion: $ sudo add-apt-repos­i­tory ppa:alexlars­son/flat­pak $ sudo apt up­date $ sudo apt in­stall flat­pak

Once it’s in­stalled, you’ll be able to in­stall Flat­pak pro­grams us­ing the com­mand line. But some GUI pack­age man­agers also have sup­port for the for­mat. KDE’s Dis­cover, for ex­am­ple, can man­age your Flat­pak files if you in­stall the ap­pro­pri­ate back­end.

With the right tools in­stalled, there’s one quick step to take be­fore you can start hunt­ing for some new apps.


Flat­pak seems to have adopted the term hubs to de­scribe col­lec­tions of soft­ware, just like RPM or DEB repos­i­to­ries. The Flat­pak site it­self hosts the first one you should add, FlatHub. Reg­is­ter it with your sys­tem us­ing your pack­age man­ager, or at the ter­mi­nal with the fol­low­ing com­mand: $ flat­pak re­mote-add --if-no­tex­ists FlatHub https:// flat­pakrepo

You can see a list of your con­fig­ured hubs by run­ning $ flat­pak re­motes


There are a cou­ple of dif­fer­ent ap­pli­ca­tion types that lend them­selves to be­ing pack­aged as Flat­paks. The first of these is com­mer­cial ap­pli­ca­tions. If the de­vel­op­ers of com­mer­cial prod­ucts don’t make it easy for the com­mu­nity to pick their ap­pli­ca­tions apart, it’s solely up to them to pack­age ev­ery­thing.

Flat­pak­givesas­in­gle­tar­get­for­pack­ages that will work across­dis­tros,and sand­box­ing the apps can help re­duce sup­port costs. Some­ex­am­ple­sof­com­mer­cial(though free) pro­gram­sinFlathu­bin­cludeSteam,Slack, and Sub­lime Text.

Another­typeof ap­pli­ca­tion that makesa goodFlat­pak­islarge,com­plexap­pli­ca­tions. These ben­e­fit from Flat­pak’s atomic up­grades, mak­ing the up­date process alit­tle less painful, and the roll-back process even less so. Li­breOf­fice, which is nor­mally a 200MB up­date, and An­droidS­tu­dio, which is even more, are both avail­able as some­what more con­ve­nient Flat­paks.

Fi­nally,cross-plat­formapp­sal­ready­have two com­pletely dif­fer­ent OS tar­gets (at least for desk­top, even more if they’re mo­bile). De­vel­op­ers and pack­agers surely don’t need to worry about the idio­syn­cra­sies of adozen Linux dis­tros on top of that. Just wrap your app up as a Flat­pak, and you’re good to go.


In­stalling ap­pli­ca­tions from the Flat­pak will feel very fa­mil­iar if you’re ac­cus­tomed to us­ing apt or ei­ther yum or dnf on your sys­tem. The search com­mand will show you hits in any of

your con­fig­ured for the keyword that you pro­vide: $ flat­pak search cal­i­bre

This will re­turn a re­sult for the ex­cel­lent Cal­i­bre e-book man­ager, which is of­ten out of date in the Ubuntu repos­i­to­ries. Note the first col­umn, which gives the Ap­pli­ca­tion ID in a sort of re­verse-do­main for­mat (com first, then do­main, and so on.). You’ll need to give this to the in­stall com­mand for Flat­pak to in­stall your pro­gram: $ flat­pak in­stall com. cal­i­bre_­i­bre

At this point Flat­pak will start down­load­ing and in­stalling your ap­pli­ca­tion and any run­times (org. freedesk­top – see the screen­shot, be­low right) it re­quires. A run­time is a col­lec­tion of li­braries and other soft­ware for the ap­pli­ca­tion. It’s the Flat­pak way of re­solv­ing your de­pen­den­cies for you.

“Wait,” you might say, “isn’t this what apt and yum do for me?” It’s a fair ques­tion. There are a few notable fac­tors that set run­times apart from nor­mal Linux de­pen­dency management. Flat­pak’s sand­box en­vi­ron­ment ≠≠ en­sures any­thing you in­stall won’t con­flict with your sys­tem proper. A run­time is a fixed set of soft­ware, ≠≠ so you know you’ll get ex­actly you need to run the app – no more, no less. Flat­paks are built against spe­cific ≠≠ run­times, so there’s no need to worry about up­grades break­ing your pro­gram all of a sud­den. The trade-off boils down to con­fi­dence that the pro­gram will al­ways have what it need­storunas­in­tended,but­notethatit’ll need to take up more disk space to do so.

There are a cou­ple of other meth­ods you can use to in­stall ap­pli­ca­tions. If you hap­pen across a rogue Flat­pak and down­load it, in­stall it from the com­mand line us­ing the com­mand above: $ flat­pak in­stall some­file. flat­pak

Fi­nally,Flat­pakpro­videsamethod­for in­stalling an ap­pli­ca­tion by run­ning an in­stal­la­tion file. This file, called a

flat­pakref, con­tains some meta­data about the pro­gram, in­clud­ing: Its full name. ≠≠ The hub from which it should be ≠≠ down­loaded. Its ver­sion ≠≠ Whether it is a run­time or not. ≠≠ Its GPG sig­na­ture. ≠≠ In­stalling from a flat­pakref file is the same as in­stalling from a lo­cally down­loaded Flat­pak file: $ flat­pak in­stall ./ somer­ef­file.flat­pakref

You can also use a GUI pack­age man­ager, which should dis­play and in­stall Flat­paks in the same way it does other pack­ages (pro­vided that you in­stalled the back­end). Once your pro­gram is in­stalled, you can launch it from the com­mand line as fol­lows: $ flat­pak run­i­bre_­i­bre

Once the pro­gram starts up, there are a cou­ple of things you’ll no­tice. The first is that you’ll have ac­cess to all your nor­mal $HOME di­rec­tory files. “But, but,” you’ll ask, “I thought the Flat­pak­sand­box was iso­lated from the rest of the sys­tem?” That’s very as­tute of you. How­ever, run­ningapro­gramthat­can’tin­ter­actwith your files isn’t very use­ful. The Flat­pak de­vel­op­ers have worked around this.

You should also see en­tries for the ap­pli­ca­tion show up in your desk­top’s menu. Un­der most cir­cum­stances, you shouldn’t be able to tell the dif­fer­ence be­tween these pro­grams and those pro­vided by your dis­tri­bu­tion. You can op­er­ate on your files, play mul­ti­me­dia files, and gen­er­ally use them as a “nor­mal” pro­gram.


Once you have a Flat­pak or two in­stalled, you can, of course, use your GUI pack­age man­ager to ad­min­is­ter them. But if you pre­fer the ter­mi­nal, some of the be­low com­mands will be use­ful. You can list the Flat­paks (both apps and run­times) you have in­stalled with the fol­low­ing com­mand: $ flat­pak list

There­sult­dis­playsno­ton­lythe­in­stalled mod­ules, but also their in­stal­la­tion type ( sys­tem/user). You can up­date all your Flat­paks with as­in­gle com­mand, just like na­tive pack­age man­agers: $ flat­pak up­date

In the event you need to re­move a Flat­pak, en­ter the fol­low­ing at the prompt: $ flat­pak re­move [ful­lqual­i­fied app name]

If you need to re­move one of the hubs you’ve con­fig­ured, you can do so with the fol­low­ing: $ flat­pak re­move-re­mote [name of re­mote]


The ben­e­fits of the Flat­pak for­mat are nu­mer­ous. It pro­vides de­vel­op­ers with an op­tion to tar­get mul­ti­ple dis­tri­bu­tions, while giv­ing users mul­ti­ple tools to in­stall the re­sult­ing ap­pli­ca­tions. It en­ables pro­grams to ac­cess the re­sources they need, while re­strict­ing them from the things they don’t. It works around some of the de­pen­dency prob­lems of tra­di­tional pack­ag­ing for­mats, at the ex­pense of a lit­tle disk space. Fi­nally, it opens up op­por­tu­ni­ties for de­vel­op­ers to wrap up ap­pli­ca­tions that are tra­di­tion­ally te­dious to in­stall in a for­mat that’s drop-dead sim­ple.

So if you want to try out the cut­ting-edge ver­sion of Li­breOf­fice or run a Wine-based game like World of War­craft, give Flat­pak a try. You re­ally can’t go wrong!

Two dif­fer­ent ver­sions of Li­breOf­fice run­ning at the same time, on the same ma­chine. Is it magic? No, just Flat­pak.

The re­sults of the flat­pak search com­mand give you the three-part, re­verse- do­main ID that you’ll need to in­stall.

Like tra­di­tional pack­age man­agers, Flat­pak will down­load and in­stall Cal­i­bre and the run­times on which it de­pends.

Newspapers in English

Newspapers from Australia

© PressReader. All rights reserved.