this post was submitted on 20 Jan 2025
5 points (100.0% liked)

Linux

49530 readers
843 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

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
top 1 comments
sorted by: hot top controversial new old
[–] Vincent@feddit.nl 1 points 2 weeks ago* (last edited 2 weeks ago)

Wait, if I run flatpak list --system --columns=application, it looks like all my Flatpaks are system Flatpaks. Running flatpak list --user --columns=application shoulds just a couple of platform packages. What am I missing out on? What is this needed for:

like forcing crappy electron apps to use wayland

(Either way, thanks for writing up a detailed guide!)