[22.04] flatpak - how to install a 3rd party flatpak app?

My preferred install method is either apt or building from source.

A couple of releases ago snapd came in and after playing it with on multiple machines I didn't liked it. So I purged it and have been living very happily after.

Except for getting Firefox switch to official repos. At first it was a pain.

So then another thing called flatpak came around and I didn't have any use case for it. But I remember reading about it in CHANGELOGs and some people seemed very excited about it.

Today I finally found an interesting software that can be only deployed via snapd or via flatpak. It's called utm_no and can be found here: GitHub - stuartlangridge/utm_no: Remove tracking parameters from copied URLs, for Ubuntu and other Linux OSes

But as odd as that might sound I did not found a way to build it from source and I believe that documentation is totally missing. Leaving me with no other choice than to install via flatpak.

After doing my homework:

I now know a little bit more about it but it seems that this does not reflect the reality of my system.

The first thing that comes to mind is that there is nothing listed with flatpak:

$ flatpak list                                                                                             
$

But yet there is nothing to update:

$ flatpak update                                                                                           
Looking for updates…
Nothing to do.
$

Of course all system updates are applied and my system is running 22.04-latest-everything

So then I tried getting creative:

sudo git clone https://github.com/stuartlangridge/utm_no/
Cloning into 'utm_no'...
remote: Enumerating objects: 183, done.
remote: Counting objects: 100% (183/183), done.
remote: Compressing objects: 100% (115/115), done.
remote: Total 183 (delta 105), reused 130 (delta 56), pack-reused 0
Receiving objects: 100% (183/183), 69.07 KiB | 1.19 MiB/s, done.
Resolving deltas: 100% (105/105), done.
$ cd utm_no/flakpak
$ /usr/bin/flatpak install flathub org.kryogenix.utm_no.yml -y
Looking for matches…
error: No remote refs found similar to ‘flathub’
$ sudo /usr/bin/flatpak install flathub org.kryogenix.utm_no.yml -y
Looking for matches…
error: No remote refs found similar to ‘flathub’
$ ./launcher.sh 
/usr/bin/python3: No module named utm_no
$ sudo ./launcher.sh
/usr/bin/python3: No module named utm_no
$

So at this point I got to ask: what is it that I do not understand with flatpak?

Hello DLS

I have just installed "utm_no" from flathub via the terminal.

I can confirm that it does not run, i.e. the Flatpak is (surprisingly*) not built correctly, or Ubuntu-Mate may have some differences with respect to how this Flatpak interacts with the base OS (my guess).

I have also uninstalled it.

  • Mr. Langridge is a well respected developer, etc., etc. :penguin:
1 Like

If you're running from source, you don't need to care about flatpaks at all; they are for distributing software to users who want to install an app and don't care or know about source code.

At the bottom of the utm_no README, you'll see it says

(for techies: run as python3 -m utm_no)

That's what you want to do, in the git checkout. Run python3 -m utm_no and it should work. (If it doesn't, take a look at the error message; you may need to install some dependencies or similar. I've assumed that someone who prefers to build all their own software knows how to fix such issues and identify them from error messages, but I'm happy to look at an error if there is one!)

2 Likes

Hm. The flatpak ought to work -- the whole point of it is that it manages all the dependencies and so on for you. But utm_no does inviegle itself into the OS somewhat; it needs to monitor your clipboard and appear in the system tray, and I may be making assumptions about what's present on a system which aren't valid for Ubuntu MATE (as you suggest). Are there any error messages or the like when running utm_no as a flatpak? (You'll need to run it as a flatpak from the terminal to see these, but I've assumed that since you installed it from a terminal, you know how to do that; if you're not sure, do speak up and I'll provide some more detail there.)

2 Likes

Wow @sil that sure is prime time support! Thanks for reaching out so rapidly. Ok so:

I had seen that, yes. However the reason why I skipped it was because I thought it was missing a bit of context. Also I didn't get how utm_no and python were already so intimate. But regardless, just tried it now:

% python3 -m utm_no
/usr/bin/python3: No module named utm_no
% sudo python3 -m utm_no
/usr/bin/python3: No module named utm_no
%

Also:

I just now realized that this wasn't very clear:

The reason I git cloned the repo was to try to build it from source actually. But I also failed. My hope was to issue some make somewhere and that it would be easy but since I also couldn't find any install instructions to guide me I came to this forum and am glad that I did :smiley:

I would also like to point out that even though there is a source code button on utm_no: remove tracking parameters from copied URLs, for Ubuntu and other Linux OSes that is sadly brings back to the same problem stated previously.

This sucks because I thought this idea was not only brilliant but should also possibly be part of my software baseline when deploying new systems.

OK. So, utm_no is written in Python, so it doesn't need building; it can be run straight from the git checkout. This ought to work for you:

$ git clone https://github.com/stuartlangridge/utm_no/
Cloning into 'utm_no'...
remote: Enumerating objects: 183, done.
remote: Counting objects: 100% (183/183), done.
remote: Compressing objects: 100% (115/115), done.
remote: Total 183 (delta 105), reused 130 (delta 56), pack-reused 0
Receiving objects: 100% (183/183), 69.07 KiB | 3.45 MiB/s, done.
Resolving deltas: 100% (105/105), done.
$ cd utm_no
$ python3 -m utm_no

Note that we cd into the utm_no directory first, because that's where it's been checked out to by git.

Note also that you do not need sudo (and, in general, you should not run downloaded programs with sudo, and if they don't work, the problem is hardly ever that they need root privileges, so I'd recommend not doing that; it will cause you problems).

Let me know if that works.

3 Likes

Hello Mr. Langridge

I was wondering how I might best be able to get some feedback about this to you, but you have taken care of that, so here we go.

I have just re-run this immediately before posting:
I installed with the Flathub instruction:

flatpak install flathub org.kryogenix.utm_no

Then I used the following Flathub instruction to (try to) run the software for the first time:

flatpak run org.kryogenix.utm_no

The following comments appeared in response to the above command:

Gtk-Message: 05:53:46.402: Failed to load module "xapp-gtk3-module"
Gtk-Message: 05:53:46.402: Failed to load module "appmenu-gtk-module"
Gtk-Message: 05:53:46.402: Failed to load module "canberra-gtk-module"
WARNING:root:couldn't restore settings (error: g-io-error-quark: Error opening file /home/john/.var/app/org.kryogenix.utm_no/config/utm_no.json: No such file or directory (1)), so assuming they're blank

... and the terminal became unresponsive (I then closed the terminal window).

I have once again uninstalled the Flatpak.

I hope this feedback helps you understand what is happening in my case, so that any general problem with the Flatpak might be identified.

  • Please note that my config files have been "carried over" on a separate '/home' partition (on a dedicated drive) since around about 15.04 or 15.10. My menu-system has somehow become "over-tweeked" by my good self, and I am only able to put off a real fresh installation thanks to the brisk menu.
  • I use Parcellite 1.2.1 as my clipboard manager.
  • This is the first Flatpak that has not worked for me (I have 30 installed, including Firefox).
  • I manage my Flatpaks in the terminal (I decide what is updated and when).

And while we're at it, thanks for 'Magnus' which I don't need yet, but none of us are getting any younger. :slightly_smiling_face:

This suggests that utm_no is running, but it's not putting its icon in the system tray. I don't know why that might be -- it would be useful to know whether anyone is successfully running utm_no on Ubuntu MATE, but I don't know how to find that out (and I don't currently have a UM machine to test this on). Perhaps someone can help?

1 Like

Thanks for those quick clarifications! So you say that by doing this it should work?

Well this doesn't seem to be right:

$ cd /opt/utm_no/utm_no
$ ls
flatpak  LICENSE  README.md  snap  utm_no
$ cd utm_no 
$ python3 -m utm_no 
/usr/bin/python3: No module named utm_no
$

Please advise.

PS:

I suppose this is the place for it to happen. And I would also suggest this is what's happening right now.

Of course, I will be replying until I get it going on the latest LTS so that could be a start for you.

Ah, you don't want the cd command there. That was there if you're git clone'ing the project; if you're running it out of a folder in /opt then cd /opt/utm_no; python3 -m utm_no should work.

1 Like