Skip to content

Flatpak adds a duplicate Flathub remote #2979

Closed

Description

@cmurf

Linux distribution and version

Fedora 30 and Rawhide

Flatpak version

flatpak-1.4.1-1.fc31.x86_64
bubblewrap-0.3.3-2.fc31.x86_64
ostree-2019.2-1.fc31.x86_64

Description of the problem

Too many confusing questions when installing.

Should the remote be kept for future installations? [Y/n]: y

I don't know? Why am I being asked? I have zero information to go on for the consequences of either a yes or a no answer.

Configure this as new remote 'flathub-1' [Y/n]: y

Same thing, no idea why I'm being asked this. I don't know what a remote is. I don't care what a remote is. I just want the app installed.

Required runtime for com.slack.Slack/x86_64/stable (runtime/org.freedesktop.Platform/x86_64/18.08) found in remotes:

  1. flathub
  2. flathub-1

Which do you want to install (0 to abort)? [0-2]: 1

This is a totally screwball question, because I got suckered into saying "yes why not?" to the 2nd question and now have two identical remotes set up. Which do I want to install? I only have an idea which one to use in this case because I just so happen to know they're identical. What if they weren't the same remote? How am I supposed to know which one to pick? Does it even matter?

These are not user friendly questions to ask.

Steps to reproduce

$ sudo flatpak install com.slack.Slack.flatpakref
[sudo] password for chris: 
The remote 'flathub', referred to by 'com.slack.Slack' at location https://dl.flathub.org/repo contains additional applications.
Should the remote be kept for future installations? [Y/n]: y
The application com.slack.Slack depends on runtimes from:
  https://dl.flathub.org/repo/
Configure this as new remote 'flathub-1' [Y/n]: y
Required runtime for com.slack.Slack/x86_64/stable (runtime/org.freedesktop.Platform/x86_64/18.08) found in remotes:

   1) flathub
   2) flathub-1

Which do you want to install (0 to abort)? [0-2]: 1

com.slack.Slack permissions:
    ipc      network      pulseaudio      x11     devices     file access [1]     dbus access [2]

Activity

  1. TingPing commented on Jun 24, 2019

    @TingPing
    Member

    Should the remote be kept for future installations? [Y/n]: y

    I don't know? Why am I being asked? I have zero information to go on for the consequences of either a yes or a no answer.

    It tells you the purpose right in the question, to install future packages from it.

    1. flathub
    2. flathub-1
      Which do you want to install (0 to abort)? [0-2]: 1

    Kinda sounds like a bug that it asked in the first place, it should have figured out you already have flathub.

  2. cmurf commented on Jun 24, 2019

    @cmurf
    Author

    It tells you the purpose right in the question, to install future packages from it.

    It's not. I didn't have this remote prior to giving it a flatpakref file, I obviously don't need it again in the future because any future flatpakref file will have what's needed. Or is it obvious? Maybe I'll want to list what other things are in that remote and install them without a flatpakref? But I can't possibly know that in advance when I know nothing about flatpaks or remotes and don't really care to know. I just want the app installed. So why wouldn't flatpak just keep it around, just in case? Is there harm in keeping it around?

    1. flathub
    2. flathub-1
      Which do you want to install (0 to abort)? [0-2]: 1

    Kinda sounds like a bug that it asked in the first place, it should have figured out you already have flathub.

    Three bugs. It encouraged me to add a duplicate remote with capital Y, rather than capital N. It actually added a duplicate (arguably the primary bug, it shouldn't even be asking the question). And that leads to the above third bug which is asking the user to resolve the duplicate question. I can't do that without flipping a coin, unless I know quite a bit more about flatpaks.

  3. TingPing commented on Jun 24, 2019

    @TingPing
    Member

    Maybe I'll want to list what other things are in that remote and install them without a flatpakref?

    That is indeed what it means. Apps from the same repo will show up in flatpak search (or your graphical app store) and you can directly install them.

  4. matthiasclasen commented on Jun 25, 2019

    @matthiasclasen
    Collaborator

    Seems to me to be a case of wrong expectations.

    While flatpak's commandline is trying to be understandable and not too cryptic, it is not a 'no question asked' interface. If you want that, try gnome-software. When using the flatpak cli, you should be prepared to learn about some fundamental concepts of flatpak, like remotes.

  5. matthiasclasen commented on Jun 25, 2019

    @matthiasclasen
    Collaborator

    That being said, there seems to be an issue here where flatpak failed to recognize that you already had the required remote, so you ended up with flathub and flathub-1, and things went downhill from there.

  6. mwleeds commented on Jun 25, 2019

    @mwleeds
    Contributor

    This sounds similar to the bug fixed by #2324 but that is fixed in the version of flatpak you're using. Could you post the output of flatpak remotes -d?

  7. cmurf commented on Jun 26, 2019

    @cmurf
    Author
    $ flatpak remotes -d
    Name   Title  URL                                    Collection ID Filter Priority Options    … … Homepage Icon
    fedora Fedora oci+https://registry.fedoraproject.org -             -      1        system,oci … … -        -
    $ sudo flatpak install -vv com.slack.Slack.flatpakref
    F: No installations directory in /etc/flatpak/installations.d. Skipping
    F: Opening system flatpak installation at path /var/lib/flatpak
    F: Opening user flatpak installation at path /root/.local/share/flatpak
    The remote 'flathub', referred to by 'com.slack.Slack' at location https://dl.flathub.org/repo contains additional applications.
    Should the remote be kept for future installations? [Y/n]: y
    F: Imported 1 GPG key to remote "flathub"
    F: Loading https://dl.flathub.org/repo/flathub.flatpakrepo using libsoup
    F: Received 4040 bytes
    The application com.slack.Slack depends on runtimes from:
      https://dl.flathub.org/repo/
    Configure this as new remote 'flathub-1' [Y/n]: y
    F: Imported 1 GPG key to remote "flathub-1"
    F: Fetching summary file for remote ‘flathub’
    F: Transaction: install flathub:app/com.slack.Slack/x86_64/stable[*]
    F: marking op install:app/com.slack.Slack/x86_64/stable resolved to 5eb3cfc6d38e11671e0f1ee0640f696c4ae198339e90c3cae3b075e054a0d0fd
    F: Loading https://registry.fedoraproject.org/index/static?annotation%3Aorg.flatpak.ref%3Aexists=1&architecture=amd64&os=linux&tag=latest using libsoup
    F: Failed to download optional summary
    F: Fetching summary file for remote ‘flathub-1’
    Required runtime for com.slack.Slack/x86_64/stable (runtime/org.freedesktop.Platform/x86_64/18.08) found in remotes:
    
       1) flathub
       2) flathub-1
    
    Which do you want to install (0 to abort)? [0-2]: 0
    error: The application com.slack.Slack/x86_64/stable requires the runtime org.freedesktop.Platform/x86_64/18.08 which is not installed
    $ flatpak remotes -d
    Name      Title                        URL                                    Collection ID Filter Priority Options    … … Homepage             Icon
    fedora    Fedora                       oci+https://registry.fedoraproject.org -             -      1        system,oci … … -                    -
    flathub   com.slack.Slack from flathub https://dl.flathub.org/repo            -             -      1        system     … … -                    -
    flathub-1 Flathub                      https://dl.flathub.org/repo/           -             -      1        system     … … https://flathub.org/ https://dl.flathub.org/repo/logo.svg
    $ sudo flatpak install -vv com.slack.Slack.flatpakref
    F: No installations directory in /etc/flatpak/installations.d. Skipping
    F: Opening system flatpak installation at path /var/lib/flatpak
    F: Opening user flatpak installation at path /root/.local/share/flatpak
    F: Loading https://dl.flathub.org/repo/flathub.flatpakrepo using libsoup
    F: Received 4040 bytes
    F: Fetching summary file for remote ‘flathub’
    F: Transaction: install flathub:app/com.slack.Slack/x86_64/stable[*]
    F: marking op install:app/com.slack.Slack/x86_64/stable resolved to 5eb3cfc6d38e11671e0f1ee0640f696c4ae198339e90c3cae3b075e054a0d0fd
    F: Loading https://registry.fedoraproject.org/index/static?annotation%3Aorg.flatpak.ref%3Aexists=1&architecture=amd64&os=linux&tag=latest using libsoup
    F: Failed to download optional summary
    F: Fetching summary file for remote ‘flathub-1’
    Required runtime for com.slack.Slack/x86_64/stable (runtime/org.freedesktop.Platform/x86_64/18.08) found in remotes:
    
       1) flathub
       2) flathub-1
    
    Which do you want to install (0 to abort)? [0-2]: 0
    error: The application com.slack.Slack/x86_64/stable requires the runtime org.freedesktop.Platform/x86_64/18.08 which is not installed
    $ 
    
  8. mwleeds commented on Jul 2, 2019

    @mwleeds
    Contributor

    I'm able to reproduce this on Fedora Silverblue rawhide:

    $ sudo FLATPAK_SYSTEM_DIR=/home/mwleeds/testflatpaksystemdir flatpak install -vv Downloads/com.slack.Slack.flatpakref 
    F: No installations directory in /etc/flatpak/installations.d. Skipping
    F: Opening system flatpak installation at path /home/mwleeds/testflatpaksystemdir
    F: Opening user flatpak installation at path /root/.local/share/flatpak
    The remote 'flathub', referred to by 'com.slack.Slack' at location https://dl.flathub.org/repo contains additional applications.
    Should the remote be kept for future installations? [Y/n]: 
    F: Imported 1 GPG key to remote "flathub"
    F: Loading https://dl.flathub.org/repo/flathub.flatpakrepo using libsoup
    F: Received 4040 bytes
    The application com.slack.Slack depends on runtimes from:
      https://dl.flathub.org/repo/
    Configure this as new remote 'flathub-1' [Y/n]:
    
  9. mwleeds commented on Jul 2, 2019

    @mwleeds
    Contributor

    It turns out this is because the flatpakref has Url=https://dl.flathub.org/repo whereas the flatpakrepo it links to has Url=https://dl.flathub.org/repo/ so they're not considered the same because of the trailing slash difference. We could either change how the flatpak{ref,repo} files are generated, or change how Flatpak compares the URLs, or both.

    A separate issue is that the remote that gets configured for the flatpakref ends up being a bit different than the one you would get using the flatpakrepo file; the former looks like this:

    [remote "flathub"]
    url=https://dl.flathub.org/repo/
    xa.title=com.slack.Slack from flathub
    gpg-verify=true
    gpg-verify-summary=true
    

    and the latter looks like this:

    [remote "flathub"]
    url=https://dl.flathub.org/repo/
    xa.title=Flathub
    gpg-verify=true
    gpg-verify-summary=true
    xa.comment=Central repository of Flatpak applications
    xa.description=Central repository of Flatpak applications
    xa.icon=https://dl.flathub.org/repo/logo.svg
    xa.homepage=https://flathub.org/
    

    Perhaps a solution to that would be to introduce a new flatpakref key Repo which would mirror RuntimeRepo in that it takes a flatpakrepo file but be for the app updates, and we would deprecate Url, GPGKey, and SuggestRemoteName. However that might affect the ability to use flatpakref files offline (not actually sure if that works in practice but it could in theory).

    And just as a side note, you shouldn't need to use sudo with flatpak (except for the repair command). It can make a mess if you ever use --user because then you're installing into the root user's installation not your own.

  10. mwleeds commented on Jul 2, 2019

    @mwleeds
    Contributor

    I guess the question is whether the equivalence of repo and repo/ is guaranteed by flatpak/ostree and therefore true for all remotes, or a quirk of how the flathub servers are set up, in which case we should patch the flatpakref generation not Flatpak. Anyone know?

  11. cmurf commented on Jul 3, 2019

    @cmurf
    Author

    And just as a side note, you shouldn't need to use sudo with flatpak (except for the repair command). It can make a mess if you ever use --user because then you're installing into the root user's installation not your own.

    If I omit sudo, flatpak install asks three fourteen times for authentication, and any subsequent command like install or remote add or delete, everyone of them wants to authentication. So if I do not use sudo, I'm constantly typing in my password. You're saying that's a bug? I definitely think this is a bug. Filed #3001.

  12. mwleeds commented on Jul 3, 2019

    @mwleeds
    Contributor

    I don't know of any other issue with using sudo beyond --user not working as you might expect (but I suppose the user is expected to know not to combine the two). I agree that if anything is broken by running sudo flatpak .. we should consider that a bug and fix it.

  13. changed the title [-]too many confusing questions when installing[/-] [+]Flatpak adds a duplicate Flathub remote[/+] on Jul 12, 2019
  14. mwleeds commented on Jul 22, 2019

    @mwleeds
    Contributor

    It turns out I had already opened an issue about the trailing slash back in March: flathub/flathub#905

  15. mwleeds commented on Jul 23, 2019

    @mwleeds
    Contributor

    Looks like ostree treats the URL the same with or without the trailing slash:

    So I think Flatpak should treat them as equivalent, but it would be good for Flathub to also add the trailing slash, to help users on the currently out versions of Flatpak. I'll submit PRs for both.

  16. added a commit that references this issue on Aug 9, 2019
  17. twtonicr commented on Aug 12, 2019

    @twtonicr

    EDITed and updated with solution. TL;DR - If on 18.04, don't install from standard repo.

    I also had this experience same as OP:

       1) flathub
       2) flathub-1
    
    Which do you want to install (0 to abort)? [0-2]: 1
    

    I proceeded with option 2, and ended up with a borked installation of flatpak
    Then I could not uninstall or do anything with GIMP.

    sudo flatpak uninstall org.gimp.GIMP
    error: Remote "flathub-1" not found
    

    For me - this turned out to be a result of installing on Ubuntu by not separately researching flatpak.
    I.e. ubuntu users install using apt. Have done for so long - it's likely others will suffer this.

    So via:
    sudo apt install flatpak # This is a problem - read on
    There is actually a package for flatpak in the official bionic repos, but it's not updated, so will result in very old v1.0.8 of flatpak

    Using a fresh 18.04 install on a VM, and going back to fresh snapshot each time, I tested both the v1.0.8 and v1.4.2 versions of flatpak with the same GIMP install method.

    The v1.0.8 consistently resulted in the questions above during gimp install.
    The v1.4.2 installed gimp cleanly.

    I had other problems on my main machine, which resulted in a repeat error about being unable to find flathub-1.

    I had a borked install, and apt purge still left flatpak files in /var/lib
    I can't recreate the original cause but I will mention it in case it helps someone else.
    e.g. everything I tried resulted in flatpak complaining about flathub-1.

    sudo flatpak repair gimp
    Working on the system installation at /var/lib/flatpak
    Pruning objects
    Erasing .removed
    Error reinstalling runtime/org.freedesktop.Platform.html5-codecs/x86_64/18.08: Remote "flathub-1" not found
    Error reinstalling runtime/org.gnome.Platform.Locale/x86_64/3.32: Remote "flathub-1" not found
    Error reinstalling runtime/org.gnome.Platform/x86_64/3.32: Remote "flathub-1" not found
    Error reinstalling runtime/org.gtk.Gtk3theme.Greybird/x86_64/3.22: Remote "flathub-1" not found
    

    Another example

    flatpak remote-delete flathub-1
    error: Remote "flathub-1" not found
    
    

    In the end I did a

    sudo apt purge flatpak
    sudo mv  /var/lib/flatpak /var/lib/flatpak_old
    

    a reboot for good measure and I then reinstalled using the repo as per here
    https://flatpak.org/setup/Ubuntu/
    And I had a good install again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions