How to install Flatpak on Ubuntu 22.04
Flatpak applications makes it easy to install latest versions of your favorite applications on any Linux platform including Ubuntu. Ubuntu by default is coming with Snap package manager preinstalled, but in case if you want to install Flatpak, you can follow the below tutorial. Flatpak is a tool used to install applications, while Flathub serves as a repository that distributes these applications to Flatpak users. Flathub is just one of several online repositories (referred to as "remotes" in Flatpak) where users can find and download software for their Linux systems. Powered by Flatpak, Flathub allows apps to run on almost any Linux distribution, making it a convenient hub for accessing a growing collection of Flatpaks.
Installing Flatpak
sudo apt install flatpak
To get the latest version of Flatpak, run the below commands instead.
sudo add-apt-repository ppa:flatpak/stable
sudo apt update
sudo apt install flatpak
Making Flatpak applications visible in the Software center
Install the Flatpak plugin for software center to view Flatpak applications inside the software center. You can now install Flatpaks without running commands. This will also install another version of software center if you are using Ubuntu 22.04 or newer.
sudo apt install gnome-software-plugin-flatpak
Adding Flathub applications
To install flathub applications in your system, add the flathub repository into the system.
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
Now you will be able to see flatpak applications inside software center. You can install flatpak apps with just a click. Or you can run below command to install apps.
flatpak install flathub org.kde.krita
Replace 'org.kde.krita' with the name of the app you want to install.
How to completely remove flatpak
Run below commands to remove all flatpak apps and flatpak itself.
flatpak uninstall --unused
sudo apt-get remove --autoremove flatpak
sudo apt-get purge flatpak