Flatpaks

Version: 

Section: 

Applications

<post by user asqwerth>

Updated 24 Aug 2018 to add newer/simpler steps based on this link: https://flatpak.org/setup/Debian/

1. Install flatpak from the repositories using Synaptic or MX Package Installer (Full App Catalogue tab)

2. install the main flatpak repository of applications (referred to as a remote in flatpak terminology), namely Flathub, with this command:

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

3. reboot.

4. to install any apps from Flathub remote, visit the Flathub site, search for an app, and then scroll down to the bottom of the app's page on flathub.  The terminal command for installing said app is listed as the second-last command, with an easy one-click facility for copying the same.  Paste command in terminal and press "enter".  No su or sudo is needed.  In the course of the installation, flatpak may ask you to confirm that the appropriate runtime (e.g a specific version of gnome/gtk3 or KDE) be also installed.  Say yes to it.

5.if there is no entry showing up in the menu for the newly-installed flatpak app, you may wish to log out and in again, or refresh the panel with:

xfce4-panel -r

If there are still no menu entries, you can run the app from terminal with the last command listed at the bottom of the app's flathub page.  You may also wish to create your own .desktop file to make the menu entry show up, but that is outside the scope of this wiki post.

6. once in a while, you may wish to update all your flatpak apps and runtimes as follows:

flatpak update

7. you can use this command to list all the apps and runtimes installed:

flatpak list

8. see this link for more of the basic flatpak commands you might wish to use:

http://docs.flatpak.org/en/latest/using-flatpak.html

 

Enjoy!

=======================================

Date of wiki entry: end 2017

Test of flatpak in VM of MX17.1 beta (default sysvinit). Steps I took to install lollypop flatpak:

1. installed flatpak using Synaptic.
2. visited this page for a list of flatpak apps: https://flathub.org/apps/
3. scrolled down to the lollypop entry, right-clicked on icon and chose "copy link location" from context menu (see note 1 below)
4. opened terminal and installed lollypop using this command:

flatpak install https://flathub.org/repo/appstream/org.gnome.Lollypop.flatpakref

where the URL in the command is pasted from the link location you copied in step 3 above. As I understand it, the link location is to the app's flatpakref file, which is a text file giving your flatpak framework instructions of what stuff it needs to download and install on your system to make your app run.

You can also copy and paste the full terminal installation command from the second tab (labelled "Command Line") of https://flathub.org/apps/ .

lollypop-appPage.png

By default the Flatpak apps page shows the first tab, which displays the various apps in pictorial/graphical icon format. The 2nd tab is a text list with the respective terminal commands for the installation of each flatpak application.

5. the installation text in the terminal noted that the flatpakref file requires that a remote (ie, a repository location) be installed from which the required runtimes and app is to be downloaded and installed. I clicked on "y" to proceed.

6. installation of runtime (the latest gnome/gtk 3.26, cool!) required root password.

7. runtime and app were downloaded and installed.

8. tried to look for it in whisker menu and couldn't find it. This puzzled me because in MX16, Lollypop and my just-installed evince 3.26 show up in whisker. Ran lollypop from terminal using this command:

flakpak run org.gnome.Lollypop

and it worked, although the terminal displayed error messages:
 

flatpak run org.gnome.Lollypop
/usr/lib/python3.5/site-packages/gi/module.py:176: Warning: g_array_append_vals: assertion 'array' failed
g_type = info.get_g_type()
/usr/lib/python3.5/site-packages/gi/module.py:176: Warning: g_hash_table_lookup: assertion 'hash_table != NULL' failed
g_type = info.get_g_type()
/usr/lib/python3.5/site-packages/gi/module.py:176: Warning: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
g_type = info.get_g_type()
Traceback (most recent call last):
File "/app/lib/python3.5/site-packages/lollypop/thirdparty/GioNotify.py", line 130, in on_Notify_finish
self._replace_id = self.call_finish(result).unpack()[0]
GLib.Error: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying (4)
tuaztest@mx171:~
$ flatpak run org.gnome.Lollypop
/usr/lib/python3.5/site-packages/gi/module.py:176: Warning: g_array_append_vals: assertion 'array' failed
g_type = info.get_g_type()
/usr/lib/python3.5/site-packages/gi/module.py:176: Warning: g_hash_table_lookup: assertion 'hash_table != NULL' failed
g_type = info.get_g_type()
/usr/lib/python3.5/site-packages/gi/module.py:176: Warning: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
g_type = info.get_g_type()

(lollypop:3): GLib-GIO-CRITICAL **: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

(lollypop:3): GLib-GIO-CRITICAL **: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
TaskHelper::__on_soup_msg_finished(): g-io-error-quark: Operation was cancelled (19)
 

9. Occurred to me that maybe the system needs to be rebooted for the newly-installed runtime to be up and running. Did so and Lollypop now shows up in whisker [for Appimage apps, you need to manually make a launcher for the files you download]

10. Flatpak Lollypop runs fine in MX17.1, even internet/streaming radio. Theming is still Adwaita though. :p
 

lollypopflatpak-mx17.png

Note 1:
You can install via the copied and pasted URL of flatpakref file like I did, or directly install the app from the remote/repo. The first seems quicker to me since for the latter, you have to type out the full name of the app, which is "org.gnome.Lollypop". The front 2 prefixes indicate which runtime the package will running under. There are flatpak apps running under KDE runtime.

Note 2:
You can update your runtime and apps. See link below. Command is:

flatpak update

without su or sudo.
 

Links

Language: 

English