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
oversystem
? 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 underuser
? 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?
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.
The user installation
The application is installed in the user's home folder. For example in:
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 withoutsudo
.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:
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.Only the "system" installation should require
sudo
.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.
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.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.
Probably not. However, it will affect the location of installation. This only matters if you have a separate "home" partition.
By running
flatpak list
, you can view packages that are installed under youruser
directory, as well assystem
. See the last column entitled "Installation":If you run
sudo flatpak list
instead, onlysystem
installations will be displayed.I don't know. Probably not.
I am not aware of any Ubuntu specific things.
You can use the command:
when you want to install the app in your home folder. For system-wide installation use:
See User vs System Install documentation.
Hope this helps