2

When I try to install a Flatpak from the Flathub website, I get a message like this one:

$ flatpak install flathub app.organicmaps.desktop
Looking for matches…
Remote ‘flathub’ found in multiple installations:
  1. system
  2. user

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

I have several questions about this:

  • What are the implications of choosing user over system? I'm interested in both security and usability.
  • Do one or both require the use of sudo or admin privileges?
  • How do I minimize the amount of disk space used? Should I consistently choose one or the other?
  • Similarly, will my answer affect the download size?
  • How can I list flatpaks that were installed under system and flatpaks that were installed under user? Can I migrate an installed package between them?
  • Are they any Ubuntu-specific things I should know that would affect my choice?
  • Can I configure flatpak to no longer ask me this question again in the future?
Flimm
  • 41,766

1 Answers1

3

I am not a flatpak expert, but I have used it to install a few applications. Let me try to answer all your questions as best as I can.


  • What are the implications of choosing user over system? I'm interested in both security and usability.

    The user installation

    The application is installed in the user's home folder. For example in:

    /home/flimm/.local/share/flatpak/app/app.organicmaps.desktop/
    

    This means the application is not accessible by anyone else. For example if this computer is used by all the members of your family, say your spouse and children, and you install it as user, then only you will be able to start and use this application. Nobody else will have access to it.

    In terms of security, installation in the user space implies no administrative permissions are used for installation. For example, if somehow a bad guy could modify the app installation process so that when you install the app it makes some unwanted system changes. Then if you use user install those system changes will not be made as the install process runs without sudo.

    On the other hand if the app needs some special system level privileges to run properly, then installing as user may not work.

    The system installation

    The application is installed in a system folder:

    /var/lib/flatpak/app/app.organicmaps.desktop/
    

    This means the application is accessible by all the users of this computer. For example if your spouse and children are users of this computer all of them will be able to start and use this application.

    The general rule "Do not install anything if you don't trust the source" applies. As usual in Ubuntu, installation is done with sudo and the installation process itself can make system changes.

  • Do one or both require the use of sudo or admin privileges?

    Only the "system" installation should require sudo.

  • How do I minimize the amount of disk space used?

    If you have three users, yourself, your spouse, and your child, you may not want to install the same app three times using three user's account. This will take up three times the disk space as the app will be installed three times in three different home folders.

    /home/flimm/.local/share/flatpak/app/app.organicmaps.desktop/
    /home/glimm/.local/share/flatpak/app/app.organicmaps.desktop/
    /home/zlamm/.local/share/flatpak/app/app.organicmaps.desktop/
    

    If your home folder is in a separate partition, the choice of "user" vs "system" will determine which partition the application is installed in. If your home partition is getting full, and the system partition, /, is relatively empty, use system option, and vices versa.

  • Should I consistently choose one or the other?

    It depends on the application. For example, if the application you are installing is a web server, it may require permission to read and write to a system folder called /var/www/. A "user" installation may not provide that access. In that case, you have to do "system" install.

    It depends on the number of users of your computer. If you are the only user, you may want to use "user" install. If you have multiple users and you want all of them to access the app, then use "system" install.

  • Similarly, will my answer affect the download size?

    Probably not. However, it will affect the location of installation. This only matters if you have a separate "home" partition.

  • How can I list flatpaks that were installed under system and flatpaks that were installed under user?

    By running flatpak list, you can view packages that are installed under your user directory, as well as system. See the last column entitled "Installation":

    $ flatpak list
    Name           Application ID            Version       Branch      Origin       Installation
    Organic Maps   app.organicmaps.desktop   2024.02.06-11 stable      flathub      system
    LocalSend      ….localsend.localsend_app 1.13.1        stable      flathub      user
    

    If you run sudo flatpak list instead, only system installations will be displayed.

  • Can I migrate an installed package between them?

    I don't know. Probably not.

  • Are they any Ubuntu-specific things I should know that would affect my choice?

    I am not aware of any Ubuntu specific things.

  • Can I configure flatpak to no longer ask me this question again in the future?

    You can use the command:

    flatpak install --user flathub <name>
    

    when you want to install the app in your home folder. For system-wide installation use:

    sudo flatpak install flathub <name>
    

See User vs System Install documentation.

Hope this helps

Flimm
  • 41,766
user68186
  • 33,360
  • Thank you for this answer! It was really helpful. – Flimm Feb 13 '24 at 23:52
  • I'm not sure if system installations get more privileges than user installations. I think both of them would need to be run with sudo to get privileges to /var/www for instance. I'm happy to be proved wrong. – Flimm Feb 13 '24 at 23:53
  • @Flimm Thanks for the output of the flatpak list. This improved the answer. I have not tested web server apps in flatpaks. I guess it may depend on the app. Typically the server app creates the www folder under /var. This may or may not work with user installation. the installation may create the www folder somewhere within your home folder. These are all untested speculations. If you do any testing, feel free to update the answer. – user68186 Feb 14 '24 at 00:05
  • The above comments is based on the fact that normally users don't have write permissions to the folder /var/ and can't create new folders within /var/ without sudo. – user68186 Feb 16 '24 at 14:22