How do I install Flathub Flatpaks on Fedora 38 XFCE?

I’m new to Qubes 4.2 and am trying to install Flatpaks from Flathub on the Fedora Personal App VM. I’ve tried using the command “flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo” but the output says that it’s unrecognized. When I download the repo file and try to open it, Gleany text editor opens the file and right clicking it I don’t see an option to run it as an application. The XFCE version of Fedora also doesn’t seem to have the Software app store so I’m pretty lost.

1. How can I install the Flathub repo?
2. Should I temporarily allow network access to my template VM to install the apps I want on all Qubes or use some other method to distribute these?

1 Like

@Droplet6200

2 Likes
2 Likes

Short answer: no. Longer answer: that is in general unnecessarily risky and goes against some of the principles behind the template system. The guides linked above may explain some of that, and this section of the official documentation explains several methods to install software in templates:

2 Likes

@Theseus Thank you for providing that info! So if I were to use Solene’s method or Qube Apps,

  1. How would I update Flatpaks installed via those methods?
  2. Would I need to update the flatpaks in each qube independently if using either of these methods or do updates apply to all qubes as if the flatpaks were installed in a template?

With the Micah Lee method via the “Update Apps” button in the “Qube Apps”. He has described it very well in his instructions.

Solene’s solution will look for flatpak programs updates each time the template starts, this is also very well described in the instructions.

The “Qube Apps” utility program must be installed in the template VM. The “Qube Apps” utility can then be assigned to each app VM. Different apps can be installed within this protected environment, so the “Qube Apps” program must always be updated individually. That’s how it was for me anyway.

But even with Solene’s method, which I have only recently started using, the individual app VMs have to be updated individually. Perhaps I overlooked something when installing this method or configured it incorrectly, but it doesn’t bother me personally, so I leave the configuration as it is.

You can test both methods first and then decide which one you prefer.

1 Like

I also got an error with solenes method. ???

I used How to install Software.from the Qubes documentation. Mostly. Installed libreoffice using Snap

A bit of change needed in documentation about where to re-set App Qube to point at Template Qubes Clone that I am using. Not sure which I might no have had to do. Also had to restart entire computer to restart the Template Qube, and I think reset something inside the App Qube.

When one goes to Settings/Appliclations clicks on “Refresh Applications” then LibreOffice appears in the list of possible Applications. I use the > to add to list of applications shown in menu. Then whe I open App Qube, I get a tab for starting LibreOffice.

I will have to experiment with installing other third party - Snap packages.

I guess some of the documentation might be upgraded.

and back to the question, would flatpak system be safer?

Flatpak is a decentralized system, where you can pull applications from a variety of sources with flathub being the most popular at the moment, the actual flatpak applications run in a sandboxed environment. So it will be completely separate from your systems runtime. And these sandbox applications include everything that you’re going to need to run the application including all of the dependencies. And generally, this also makes flatpaks secure, because it won’t actually interfere with your system at all unless if you give it explicit permission to do so.

A negative of flatpaks (and other sandboxed packages) compared to your distributions native package management system is the file sizes are going to generally be larger because of all those preincluded dependencies.

Thanks for answer about value of Flatpak.

Flatpak is already installed in Fedora38 the OS. Qubes Fedora I think not. To install it.

This does not answer the original question poised by OP. How to set up communication with repo. If I expand out the terminal I see a message about something needs to be reset, restarted. ???

I hope someone has a better answer to this before I resume researching/testing this.

EDIT: Next day. I know that Solenes instructions nearly worked in September, with an earlier version of Qubes, I was re-directed in some places by terminal suggestions. And I needed to stop before I got it finally finished. Other obligations.

I am going to guess my issue now might be.
I messed up my template Qube from using Snap install first.
The instructions were written for having the Gnome desktop active, and some of its, inner workings. I think the object of not having a fuller feature of Gnome was size ?
Or was it speed? Or to reduce attack surface?
these instructions would work in a Debian environment (not DNF but Apt commands that is) ???

I keep hoping someone will jump in and write, "Hey, "All you had to do was this other detail, that “I” should have known to do???

I did not start my own thread on this, because I knew the moderators would join them anyway. Sorry, I did not intend to take over someone else’s thread.

I approached installing flatpaks in a different way, Starting with Solene’s list of how to: Solene'% : Flatpak integration in Qubes OS templates

Apparently somethings have changed since Solene wrote this page.

I have documented some of what happened as I tried to follow her path.
I was unsure of what way I should act upon her line, “Install as root.” As root is not normally used in Qubes, Felt she was indicating that I might need to add the word sudo then space. Or she meant her line for those who had added a root password when they first installed Qubes.

My first change from her directions was to create a standalone Qube to work in; based upon the standard Fedora-38-xfce. I did the creation of the standalone from the blue Qube on the upper right hand side of screen.

I again got the error message bash flatpak not found :: so I installed flatpak. sudo dnf install flatpak

I see the message in terminal about – to dom0 hope that all went well.

I got to a point where it said I should have restarted. so I restarted the one Qube. I ran several of Solenes webpage scripts. Despite errors I ran some more to try to get more info. this is what I saw in Terminal

Complete!
[user@fedora38-flatpak ~]$ flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Note that the directories

‘/var/lib/flatpak/exports/share’
‘/home/user/.local/share/flatpak/exports/share’

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

[user@fedora38-flatpak ~]$


[user@fedora38-flatpak ~]$ mkdir -p /home/user/.config/environment.d/
cat </home/user/.config/environment.d/proxy.conf
https_proxy=http://127.0.0.1:8082/
EOF
[user@fedora38-flatpak ~]$ ip route add default via 127.0.0.2
RTNETLINK answers: Operation not permitted
[user@fedora38-flatpak ~]$


[user@fedora38-flatpak ~]$ #!/bin/sh

when a desktop file is created/removed

- links flatpak .desktop in /usr/share/applications

- remove outdated entries of programs that were removed

- sync the menu with dom0

inotifywait -m -r
-e create,delete,close_write
/var/lib/flatpak/exports/share/applications/ |
while IFS=‘:’ read event
do
find /var/lib/flatpak/exports/share/applications/ -type l -name “*.desktop” | while read line
do
ln -s “$line” /usr/share/applications/
done
find /usr/share/applications/ -xtype l -delete
/etc/qubes/post-install.d/10-qubes-core-agent-appmenus.sh
done
bash: inotifywait: command not found
[user@fedora38-flatpak ~]$


I should add, I am using the hospot on my iPhone 14 Plus with ATT.
in the past ATT has --“protected me”-- from the evil Linux by blocking things.

Is this another instance of that??

my tutorial aims at installing flatpak program in templates, so you need to install them as root.

If you want to install flatpak programs in AppVm, it’s easier, just use flatpak install --user

1 Like

Solene, thanks for your efforts.

Might be the previous time I got your page to install flatpak things, months ago I might have been on Library internet. not reliant on hotspot and ATT helping me by blocking some things.

I would feel your original thought to create a template was best. As I said in other posts, I got error messages. from the second line.

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

I will try your command. then try to change my internet connection to Tor, and try your entire webpage.

For whomever else who wants to tell me. Applications not available in a Qube would be --Software, from where one could install some things. Like the Mullvad App. (although I never got bind-dir to hold it) guessing an installer might come in handy with some other standard Linux apps.

You certainly forgot to run the command defining the environment variable https_proxy to allow flatpak to reach the Internet, as the templates aren’t directly connected to the network.

Yes I was trying to read that when the text is like a 64 of an inch high, I missed it.

Mayhaps someone could tell me, where the config file mentioned ’ /rw/config/rc.local:’ is how to write into it.

and allow Solene to add that to her notes.

Then , for a newcomer a better how to: specifically. Line by Line. accomplish some of the things, like those in 3.2

If no one does that, I will research that this weekend. I did not take Linux in college.

In order to edit a file in a template as the super admin user (called root), open a terminal in your template and type:

sudo gedit

Gedit is the command to run a simple text editor, and sudo is a command to run the command after it as the super user (sudo stands for su do, with su meaning super user).

Then:

  • click on Open
  • click on “Others Locations”
  • click on “Computer”
  • click on “rw”
  • click on “config”
  • click on “rc.local” to open the file
  • make changes to the file
  • save the changes
1 Like

Sorry for the hiatus — I got occupied with some other things and didn’t have a moment to follow through the Qube Apps app instructions.

Anyway, today I found that you can install Gnome Software (sudo dnf install gnome-software). However, only Flatpaks installed on the template VM are persistent. How should I install Flatpaks in the Work app VM to have them be persistent? (be able to have them show in the VM’s app menu and save app configurationa).

Using Flathub apps’ install commands with “–user” in the front just output an error message in the terminal (–user: command not found).

Installing from Gnome Software app on the Work app VM isn’t persistent either.

It’s --user with two dash character

That’s what I meant. It seems that the forum interprets two consecutive dashes as an em dash. I think the error is actually with the commands from Flathub and not with --user. How can I adjust the commands to work on XFCE?

--user is a parameter to the command flatpak, so it must be after flatpak

it should look like flatpak remote-add --user --if-not-exists ......

1 Like

That solved it. Thank you! <3

1 Like