this post was submitted on 25 Oct 2023
5 points (100.0% liked)

Fedora Linux

1651 readers
1 users here now

All about Fedora Linux

founded 5 years ago
MODERATORS
 

I'd like to be able to install all apps from flathub. Do I have to reinstall all fedora-flatpak apps?

top 1 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 10 months ago* (last edited 10 months ago)

I'll just throw this into the wild: don't use it without reading.

It doesn't catch the last installed app from fedora. The last app needs to be reinstalled manually. (potentially only if it's the last line.

It needs to be polished before it could be used reliably. It worked for me, I'm done for now.

you have to confirm manually

#!/bin/bash

#flatpak remotes
#flatpak remote-delete fedora

x=$(flatpak list --columns=app)

echo "following apps are installed from fedora's flathub list";
echo 
echo 

for i in $x:
do
        echo "$i"; 
        # org.fedoraproject.Platform is not in flathub, only in fedora's
        if [[ $i != "org.fedoraproject.Platform" ]]; then
        #       echo "$i"
        #       echo $(flatpak list | grep $i | grep "fedora")
                if [[ $(flatpak list | grep $i | grep fedora) ]]; then
                        echo "$i";
                        echo "$i" >> fedora_flatpaks.txt;
                        # note: you have to uninstall first because the same app can't be installed from two repos
                        flatpak uninstall "$i" 
                        flatpak install flathub "$i" 
                fi
        fi
done

echo "done for now"
# have a look into the flathub filter from fedora
#cat  /usr/share/flatpak/fedora-flathub.filter
# remove filter (not neccessary anymore since list is empty)
#flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

# list all apps
#cat fedora_flatpaks.txt