B
BlueBuild2mo ago
Ion

How to remove all flatpaks installed from the fedora flatpak repo, remove the fedora repo,

and re-install the flatpaks from flathub and my own packages of choice. Do I have to do that with a script?
10 Replies
fiftydinar
fiftydinar2mo ago
I think that you would have to do that as a systemd service if you want it automatic but if you want it to execute only once, than you can do it with a simple script
Ion
Ion2mo ago
The script:
# This will return an array of all flatpaks installed from the fedora flatpak repo, (except "org.fedoraproject.Platform").
fedora_repo_flatpaks=($(flatpak list --columns=application,origin | awk '$2 == "fedora" {print $1}' | grep -v "org.fedoraproject.Platform"))
flatpak remove "${fedora_repo_flatpaks[@]}"
flatpak remote-delete fedora --force
flatpak install --system -y "${fedora_repo_flatpaks[@]}"
# This will return an array of all flatpaks installed from the fedora flatpak repo, (except "org.fedoraproject.Platform").
fedora_repo_flatpaks=($(flatpak list --columns=application,origin | awk '$2 == "fedora" {print $1}' | grep -v "org.fedoraproject.Platform"))
flatpak remove "${fedora_repo_flatpaks[@]}"
flatpak remote-delete fedora --force
flatpak install --system -y "${fedora_repo_flatpaks[@]}"
fiftydinar
fiftydinar2mo ago
that should work just have to add logic for "${filtered_fedora_flatpaks[@]}"
Ion
Ion2mo ago
I'm using the old ublue-system-flatpak-manager script (https://github.com/ptinopedila/ptinopedila/blob/main/files/shared/usr/bin/ublue-system-flatpak-manager), so I think I can add it there. That was a typo. I used grep to filter out the fedora platform and forgot to remove the filtered variable I really wish it was fast and simple to create a custom iso similar to bluefin. I would love to have the flatpaks on the iso Also, I wish I could use the default-flatpaks module, but I don't want to configure flatpaks in multiple places.
xyny
xyny2mo ago
https://github.com/JasonN3/build-container-installer makes it really as easy as can be but unfortunately this is a problem, yeah it might be possible to set up some singular file to contain the flatpak list but it gets kind of complicated...
Ion
Ion2mo ago
I might just run the command to remove the flatpaks from fedora and just manually add them to a list using the default-flatpaks module. If fedora adds more flatpaks in the future, or removes some, then I will have to manually update my list.
xyny
xyny2mo ago
that would work i guess
Ion
Ion2mo ago
are there any examples? And also.. does it handle flatpaks?
xyny
xyny2mo ago
yes, it handles flatpaks, you can ctrl-f "flatpak" from the readme it's what is used on our tutorial page https://blue-build.org/learn/universal-blue/#fresh-install-from-an-iso you can use the github action to build, or look at how the github action uses the container by scouring the action.yml trying to find the parts specific to flatpak the ISOs are likely to be too large for github releases, but github artifacts might be able to hold them
Ion
Ion2mo ago
Thanks for the help
Want results from more Discord servers?
Add your server