so my Fedora installation was upgraded in place from 35 onward, survived three SSD upgrades (all glory to btrfs send | receive), got switched to systemd-boot, then from Gnome to Plasma, so there’s some junk hanging about.

one of those is my flatpak setup that’s system-wide, as was the style at the time, instead of the current user-level. although everything works, there are enough irritants (like forcing crappy electron apps to use wayland) that the old way is just a chore now. so, here’s my brief write-up on how I made the switch.

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

flatpak list --system --columns=application > system_flatpaks

edit the list by removing various org.kde., org.gtk., org.freedesktop., etc. runtimes and save it as e.g. flatpak_apps. otherwise, the following install and remove processes will ask tons of questions as to versions and nobody got time for that; the unused runtimes will be autoremoved later.

flatpak install --user $(cat flatpak_apps)

after it’s done, time to pull the dependencies; no idea why they don’t get pulled in the first place, when installing? anyhoo:

flatpak --user upgrade

will pull everything that’s needed. thanks to the glory of btrfs deduping, this won’t take up any additional space as it’s already on the disk. to remove the system apps:

flatpak remove --system $(cat flatpak_apps)

after it’s done, the runtimes:

flatpak remove --system --unused

and finally list all the system repos and remove them:

flatpak remotes --system
flatpak remote-del --system {flathub,flathub-beta,fedora-testing}

all app data remains safe and untouched in ~/.var/app, everything works as before and no reboots necessary. from this point forward, it’s not neccessary to include the --user switch.

bonus content: if you haven’t set up flatpak autoupdate, fix that post-haste.

~/.config/systemd/user/flatpak-autoupdate.service

[Unit]
Description=Update user Flatpaks  
  
[Service]  
Type=oneshot  
ExecStart=/usr/bin/flatpak update --assumeyes --noninteractive  
  
[Install]  
WantedBy=default.target

~/.config/systemd/user/flatpak-autoupdate.timer

[Unit]  
Description=Update user Flatpaks daily  
  
[Timer]  
OnCalendar=daily  
Persistent=true  
  
[Install]  
WantedBy=timers.target
systemctl daemon-reload
systemctl --user enable --now flatpak-autoupdate.timer
  • dingdongitsabearOP
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    5 hours ago

    they are switches for electron apps, as some of them default to run under X11. so for e.g. element, it should be flatpak run im.riot.Riot --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer --ozone-platform=wayland.

    you can check if all your apps are using wayland by running xlsclients in terminal while you got them open; an empty response means all wayland.