Here is my alias for that and use it in bluefin/aurora/fedora workstation and nixos:
alias my-flatpacker='echo -e "\e[1;32m[✔]\e[0m Checking updates for installed flatpak programs...\n" && sudo flatpak update -y && sleep 1 && echo -e "\e[1;32m[✔]\e[0m Removing Old Flatpak Cruft...\n" && flatpak uninstall --unused && flatpak uninstall --delete-data && sudo rm -rfv /var/tmp/flatpak-cache-* && [ -f /usr/bin/flatpak ] && flatpak uninstall --unused --delete-data --assumeyes && flatpak --user uninstall --unused -y --noninteractive && /usr/bin/flatpak --user update -y --noninteractive && /usr/bin/flatpak --user repair && rm -rf ~/.var/app/*/cache/fontconfig/* && flatpak repair && echo -e "\e[1;32m[✔]\e[0m All updates and cleanups are complete."'
what this does is:
- Check and update installed Flatpak applications
- remove old and unused Flatpak cruft
- Clear the Flatpak fontconfig cache
- repair any Flatpak issues.
- Confirm’s that all updates and cleanups are complete…enjoy
to use, copy that into your .bashrc
and call my-flatpacker
or what ever you wish to name it