Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to user installation #4099

Open
adrm opened this issue Jan 29, 2021 · 9 comments
Open

Default to user installation #4099

adrm opened this issue Jan 29, 2021 · 9 comments

Comments

@adrm
Copy link

adrm commented Jan 29, 2021

Linux distribution and version

All

Flatpak version

All

Description of the problem

As a normal home user of flatpak, it doesn't makes sense to me that all flatpak commands are run at the system level by default. In a shared computer, or single-user computer, there is no need for system-wide installations or updates.

Since as far as I understand the private user is the target user of flatpak, it seems to me that it is a saner default that flatpaks are installed on the user level so that:

  • Unexpected apps do not appear for other users in shared multi-user systems.
  • Installation might be faster if it does not need system privileges.
  • The expectations of the typical user match the defaults of the tool: when I install an app it is installed in my user account.

I am suggesting this from the perspective of an user, so there might be other reasons for this default which I don't know, but this kind of defaults trickle down to final-user tools like Gnome Software and others, and that is why I think it is important to set the best possible defaults.

@AdrianVovk
Copy link
Contributor

I agree with this sentiment, especially with the advent of systemd-homed. However, there's always the problem of compatibility. Tools expect Flatpak to default to the system installation. Maybe this can happen at a 2.0 or a big API/ABI break? Also, end-user tools like GNOME Software or Souk can use the user installation on their own terms without Flatpak defaulting to it. That's just not implemented, and in fact user-installed Flatpaks can trip these tools up because they don't expect it (which, IMO, is really bad. I have issues open on these tools to get them to support/default to user installs)

@mwleeds
Copy link
Collaborator

mwleeds commented Feb 9, 2021

I think the logic for defaulting to installing apps system-wide is that is how apps are installed on package-based systems (deb/rpm) and therefore the expected behavior. See the discussion here: https://gitlab.freedesktop.org/pwithnall/malcontent/-/issues/30#note_687925

@LeonardoSanBenitez
Copy link

I also feel that user-wise installation should be the default

@Rcomian
Copy link

Rcomian commented Jul 25, 2022

Just been searching google to find out how to make flatpak use the --user flag by default. I was expecting to find a configuration file somewhere.

Adding this comment to support this issue tho.

@mwleeds
Copy link
Collaborator

mwleeds commented Jul 26, 2022

If you want Flatpak to default to installing to your user installation, you can simply only configure remotes in your user installation. The Flatpak CLI will then use the user installation without requiring you specify --user.

That is assuming you have control over the whole system. If it's a case where the sys admin has configured remotes in the system-wide installation and you want to have your own Flatpaks in the per-user one, I can understand why you'd want to be able to default to per-user rather than system-wide. But (a) there's a reason Flatpak defaults to system-wide, (b) the idea of a config file has been discussed and rejected in #2887, (c) it's not possible to change the default without breaking backwards compatibility, and (d) multi-user systems where you have a sys admin controlling the system-wide installation are probably rare anyway.

So I don't really see this issue going anywhere...

@akdev1l
Copy link

akdev1l commented Apr 14, 2023

Hi, I've been running an OSTree system build using OCI for a while.

With a move towards immutability on the desktop as represented by Fedora Silverblue picking up in popularity and projects like uBlue (disclaimer: I'm a contributor) coming out I think it would be a good time to reset this default to a more saner (immutable-er) default.

I've been running flatpak --user for years and I have never run into any issues so it seems quality-wise the software is quite ready.

@voidpointertonull
Copy link

the idea of a config file has been discussed and rejected in #2887

Where the rejection is:

command line applications generally don't have config files, because they are used in shells and all sort of places where you expect the behaviour to be the same each time, not vary depending on what user is running it.

But the "solution" to this problem is:

you can simply only configure remotes in your user installation

Is the issue with me, or does this just not make any sense?
No user config file because there shouldn't be config files, but the default behavior depends on the system's config (file).

I started looking into this issue because I was surprised that I couldn't find the binary of an installed program in my home, but I thought there was just no way flatpak could have installed it anywhere else, I never ran it with sudo.
Then as I started finding out what was going on, it dawned on me that I was looking at years of progress getting undone:

  • With the help of a sneaky Polkit rule, an innocent looking command with no explicit privilege escalation now conveniently modifies the system affecting all users
  • Supporting the XDG base directory specification wasn't a spicy enough topic, now users get to enjoy some of the files going even outside the home directory
  • After most users barely needed to touch system-wide files directly with mostly /etc/{hosts,fstab,crypttab} remaining the outliers which don't have good multi-user replacements, now users get to enjoy making changes expected to be per-user (who's expecting magical privilege escalation in the background?) breaking down regular multi-user boundaries by default

I don't want this to be perceived as too much of a rant, I applaud what was achieved by Flatpak, but I'm really stunned how did it get away with breaking down basic multi-user principles and expectations simply because desktop setups happen to be single-user nowadays.

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Dec 5, 2023

#4099 (comment)

@adrm, as long as the user can retroactively choose to modify their installation of flatpak to default to system, I don't care. If not, I oppose this until that is true.

@johnmmcgee
Copy link

I would like the option to default to user, without the need to disable the system wide flatpak repos. I state this as it allows for you to allow some apps to stay system wide and allow per user apps as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants