So, I just installed Fedora. Installing my favorite applications was on the list of things to do after installing Fedora.
I tried installing VLC in Flatpak form, but it gave me an error:
error: No remote refs found similar to ‘flathub’
Fixing “no remote refs found similar to flathub” error
The fix is rather simple. Add the Flathub repository in the following way:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
It will ask for your password, or you could use the above command with sudo.
Now, if you try to install a Fltapak package from Fltahub, it should work as expected.
Reason why you see this error and how it was fixed
Now that you have fixed the error, it would be a good idea also to learn why you saw this error in the first place and how it was fixed.
Like most other package managers in Linux, Flatpak also works on the concept of repositories. In simpler words, you can imagine package repositories as a warehouse where packages are stored.
But to retrieve a package from this warehouse, you need to know the warehouse's address first.
That’s what happens here. You are trying to download (and install) a package from a certain repository (Flathub in this case). But your system doesn’t know about this “flathub”.
In order to solve this issue, you added the Flathub repository. When you do that, your Linux system can look for the package you are trying to install in this repository.
You may see all the remote Flatpak repositories added to your system.
Let’s have a deeper look at the command which was used for adding the repository:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- flatpak: this is the flatpak CLI tool.
- remote-add: this option indicates that you are adding a new remote repository.
- –if-not-exists: this ensures that the remote repository is only added if not already added.
- flathub: this is a short reference for the actual repository's complete URL. You may name it something else but the convention is to use the one provided by the developer.
- https://flathub.org/repo/flathub.flatpakrepo: The actual repository address.
The bottom line is that when you see Flatpak complaining about ‘no remote refs found similar to xyz’, verify that the said repository is not added and if that’s the case, figure out its URL and add it to the system.
I hope this quick tip helps you with this Flatpak issue.