Noob question about install syntax

Just wondering why install instructions on flathub say ‘flatpak install flathub [package name]’ as opposed to just ‘flatpak install [package name]’. I know that the latter works because I’ve done it in the past. I’m just wondering if there’s any meaningful difference between the two. Do they do the same thing, or is it important to include ‘flathub’ in the command?

Well, that is relatively simple: The additional flathub refers to the remote from where the app should be installed to.
If you, like many people, only use the Flathub remote, this is of course not necessary.

However, you can have multiple remotes, sometimes even with apps with the same id. An example would be a beta release of an app on flathub-beta.

So, the official instructions include the remote to clearly specify where to install from, even when multiple remotes are active.

3 Likes

Ahh. Ok, that makes sense. So it’s similar to specifying which repo to install from on your distro of choice. Like specifying core, extra, or multilib on Arch. In my experience, when installing software from the Arch repos, if there are packages in multiple repos with the same name, pacman will explicitly ask the user which source to install from. Will flatpak do the same thing if you don’t specify flathub or flathub-beta?

Yes, if an app is available in multiple remotes, it will prompt you to choose the remote.

Its just that if you provide an ready-to-use install command, you want to add as little variation your users need to worry about as possible, which is why the remote is defined here.

1 Like

This topic was automatically closed after 2 days. New replies are no longer allowed.