26.04 flatpak apps installation faulty

Trying to install flatpack keepassxc because snap has older release. Installation worked and despite $XDG_DATA_DIRS having /home/bernhard/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/share/budgie-desktop:/usr/share

The desktop file was not found. I had to copy form the flatpak environment to .local/share/application which solved the startup problem but the icon was not found. I had to change the desktop entry line 39 to:

Icon=/home/bernhard/.local/share/flatpak/exports/share/icons/hicolor/256x256/apps/org.keepassxc.KeePassXC

There seems to be an incomplete flatpak apps integration or the ubuntu-budgie-desktop doesn’t know about $XDB_DATA_DIRS entries. It shouldn’t be necessary for a user to make these changes after the flatpak app installation.

Hi @agingskier!

I don’t use KeepassXC, but before you blame it and start tinkering with settings, I think you should install Flatseal to give it the permissions it lacks by default due to Flatpak’s containerized design:

flatpak install flathub com.github.tchx84.Flatseal


Launch it, go to the ā€œFilesystemā€ section, and grant access to all system files.
It’s not a fine-tuned solution, but it should work.
Then, with a little searching, you should be able to figure out how to do exactly what you want.

Thanks for the tip, but I don’t think access rights have anything to do with my problem. I didn’t mean to blame anything or anybody, but I tried to use keepassxc on the ā€œubuntuā€ desktop and to my surprise it worked perfectly. So what is the difference between the two desktops? I found that the desktop file org.keepassxc.KeePassXC.desktop file in ~/.local/share/flatpak/exports/share/applications is a link to a rather complicate location. I suspect the difference is one ā€œubuntu desktopā€ accepting links, but ā€œbudgie desktopā€ not. Could this be it?

To be sure, I just installed KeePassXC as a Flatpak:

flatpak install flathub org.keepassxc.KeePassXC

echo $XDG_DATA_DIRS
/usr/share/budgie-desktop:/home/jean/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop


Sorry @agingskier, no issues whatsoever with the launcher:

/var/lib/flatpak/app/org.keepassxc. KeePassXC/x86_64/stable/c6c60a9c0b105ac68672b3eefbca498f8fcd820887c2182009a2013f63713cf3/export/share/applications/org.keepassxc.KeePassXC.desktop

38 Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=keepassxc --file-forwarding org.keepassxc.KeePassXC @@ %f @@
39 Icon=org.keepassxc.KeePassXC

Well, it seems I have an awesome computer since I never have the problems other users have… :flushed_face:


Uninstall:

flatpak uninstall --delete-data Keepass

… and reinstall? :thinking:

Hi jlb,

Something must be wrong with my XDG_DATA_DIRS. I’m going to delete flatpak completely and start from scratch. Hopefully with more luck :pensive_face:

I haven’t changed anything in $XDG_DATA_DIRS… :thinking:

Now we are getting closer. I went through a complete reinstall of flatpak. Here the sequence of steps and results:

  • flatpak uninstall --all --delete-data
  • sudo apt remove flatpak --purge
  • rm -rf $HOME/.local/share/flatpak (the dir was still there)
  • sudo rm -rf /var/share/flatpak (the dir was still there)
  • logout / login
  • $XDG_DATA_DIRS was /usr/share/budgie-desktop:/usr/share
  • reboot (just in case)
  • sudo apt install flatpak gnome-software-plugin-flatpak
  • Install keepassxc according to: Download – KeePassXC
  • flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Note that the directories

ā€˜/var/lib/flatpak/exports/share’
ā€˜/home/bernhard/.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.

  • $XDG_DATA_DIRS /usr/share/budgie-desktop:/usr/share (no flatpak keepassxc installed yet)
  • flatpak install --user flathub org.keepassxc.KeePassXC
  • result: same notes as on previous flatpak remote-add command
  • directories ā€œ$HOME/.local/share/flatpak/exports/shareā€ and ā€œ/var/lib/flatpak/exports/shareā€ created.
  • logout / login
  • $XDG_DATA_DIRS /usr/share/budgie-desktop:/usr/share
  • reboot
  • $XDG_DATA_DIRS /usr/share/budgie-desktop:/usr/share

I found suggestions to add an export XDG_DATA_DIRS=ā€œā€¦ā€ command with the necessary directories, which I tried and got myself in a mess and opened the topic. Or even to add a script to /etc/profile.d/custom-xdg.sh!

Now I ask myself: is it flatpak’s job or ubuntu-budgie’s job to set the variable. (I found that the entry for snap apps is missing as well). How can I debug this setup?

What amazes me, is when I login with ā€œubuntuā€ desktop, the XDG_DATA_DIRS variable is set as expected and works.

I’m really sorry to bother you that much. My next step will be to reinstall Ubuntu-Budgie.

I am using easyflatpak and i am very satified with it. Just a suggestion.

I don’t know what to tell you @agingskier; I’ve always dumbly followed the instructions on this page:

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

I’ve never installed ā€œgnome-software-plugin-flatpakā€, and I don’t use a graphical interface — neither ā€œeasyflatpakā€ nor even Bazaar (no more than ā€œSoftwareā€) — I prefer using the terminal: at least you can see what’s happening.


After that, but only after that, I install Flatpak applications by copy-pasting the ā€œManual Installā€ code from the ā€œInstallā€ button:

flatpak install flathub org.keepassxc.KeePassXC


And I had never looked at $XDG_DATA_DIRS before you mentioned it.


Personally, I’ve never had any issues.

A couple of friends couldn’t access certain directories, but that was with very specific applications — hence my first recommendation to install Flatseal. :roll_eyes:

Hi all,

I found what caused my problem. It seems that ā€œmyā€ ubuntu-budgie desktop does not source /etc/profile.d/flatpak.sh :worried:

I entered ā€œsource /etc/profile.d/flatpak.shā€ in my .zshenv file, restarted the system and voilĆ , my XDG_DATA_DIRS is corret:

/usr/share/budgie-desktop:/home/bernhard/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share

It can’t be that budgie desktop has a prolem - it must be installation, therefor I’m going to reinstall Ubuntu-Budgie from scratch. :smiley:

Just a guess, if it’s not too late: UB comes with Bash, so you might not need to reinstall. :thinking:

My zsh shell is the culprit. Switch to bash and the variable xdg_data_dirs is fine!

The concise solution is to add a line in .zshenv

emulate sh -c 'source /etc/profile

Well done, you did it, @agingskier!
ā€œAide-toi, le Ciel t’aideraā€ (Help yourself, and heaven will help you), as they say in France.
May I ask a silly question?
Why Zsh?

Hi Jib,
sorry for my late reply. Re. my zsh usage: I have no particular reason to use zsh. I used to have the bash shell active and was happy with it, but at the same time I like to look around and came around a youtube presentation about zsh. I thought, I give it a shot and I liked the zsh prompt a lot. That’s why I ended up with zsh. Lately I’m trying the fish shell as well but so far I’m sticking with zsh.
Probably a boring reason, but good enough for me. :smiley:
regards
bernhard

Thanks so much, Bernhard!

That’s a good reason, and I totally understand it, given how many kinds of tinkering I’ve done — in fact, I think that’s what I love about Linux: being able to try out all sorts of things even if you’re not a computer guru.
Have you ever been tempted to try the fish shell? I hear it’s even better!

I’ll give fish shell a shot later on but currently I’m cleaning up my ansible-pull environment as Ubunut-Budgie 26.04 produced some funny behavior. Number one my login screen had extremely tine characters I could hardly read. So, I created and ansible yml file to change sddm theme.conf file - wasn’t easy to create the correct regex expression - chatgpt help me a lot.:blush:

If I tell you I don’t understand… Isn’t editing the file enough?
And do you need AI for that?

Hi Jean,
With every new release of Ubuntu-Budgie, I delete all partitions and start from scratch to get rid of all the clutter accumulated over time. To install the release I use ansible-pull because I can’t remember all the details. Therefor the ansible file to change the sddm theme.conf file. Obviously changing the values once would be easier with the editor. Hope that explains my reason to use ansible.
regards
bernhard

If it helps there is a command line interface to change the theme - for example

 sudo slicksddm-customize --set "LockScreen/background=/path/to/jpeg"