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

Ability to set the --user flag as default #3552

Closed
julientechdev opened this issue Apr 11, 2020 · 21 comments
Closed

Ability to set the --user flag as default #3552

julientechdev opened this issue Apr 11, 2020 · 21 comments

Comments

@julientechdev
Copy link

I find myself always installing/managing flatpak apps as user apps.
Is there a way to configure the --user flag as default instead of --system ?
I understand an shell alias could do the trick, but it would be cleaner if set directly on flatpak config IMHO.
If such a feature does not exist, please consider this ticket as a feature request.

@mwleeds
Copy link
Collaborator

mwleeds commented Apr 20, 2020

If the system installation is empty, you should be able to leave off --user and have the user installation still be used. Is your use case that you have some things installed system-wide and others per-user?

@julientechdev
Copy link
Author

Yes, I removed system apps and now it implicitely use --user.
Thanks @mwleeds

@rezad1393
Copy link

I have the same problem but it still ask for user or system choice.
I dont seem to have any flatpak installed in system.

@mwleeds
Copy link
Collaborator

mwleeds commented Aug 21, 2020

@rezad1393 use flatpak --system remote-list to see if you have remotes defined there

@teohhanhui
Copy link

I'd really like to be able to do flatpak install ... as --user by default, instead of it telling me nothing matches (because the specified remote doesn't exist in --system).

@mwleeds
Copy link
Collaborator

mwleeds commented May 26, 2021

I'd really like to be able to do flatpak install ... as --user by default, instead of it telling me nothing matches (because the specified remote doesn't exist in --system).

Not sure what Flatpak version you're on but the expected behavior is that the install command will automatically detect that the per-user installation should be used if the specified remote exists there and only there.

@teohhanhui
Copy link

Uhh, you're right. Sorry about that.

It just gives a confusing message when the branch is not matched, e.g.

$ flatpak install flathub org.mozilla.firefox//beta
Looking for matches…
error: Nothing matches org.mozilla.firefox in remote flathub

@mwleeds
Copy link
Collaborator

mwleeds commented May 26, 2021

Yeah that's confusing, added a comment to #3996

@teohhanhui
Copy link

I've noticed an undesirable case when trying to install like this:

$ flatpak install https://nightly.gnome.org/repo/appstream/org.gtk.WidgetFactory4.flatpakref

It defaults to --system even though there are no remotes configured there.

@teohhanhui
Copy link

Another example:

$ flatpak install --from https://firefox-flatpak.mojefedora.cz/org.mozilla.FirefoxNightly.flatpakref

Expected result: It should default to --user.

Actual result: It defaults to --system.

@akdev1l
Copy link

akdev1l commented May 9, 2022

https://docs.flatpak.org/en/latest/using-flatpak.html

Flatpak commands are run system-wide by default. If you are installing applications for day-to-day usage, it is recommended to stick with this default behavior.

However, running commands per-user can be useful for testing and development purposes, since objects that are installed in this way won’t be available to other users on the system. To do this, use the --user option, which can be used in combination with most flatpak commands.

where is the behaviour above documented? The flatpak website seems to say --user is always required

@rusty-snake
Copy link

You mean which flatpaks command has no support for --user?

All where it makes no sense. Look at flatpak <command> --help. Example: flatpak enter --help.

@akdev1l
Copy link

akdev1l commented May 11, 2022

No, the documentation suggests flatpak install always works on the system wide storage.

This thread seems to say I can or cannot use --user as long as I have a configured remote as --user.

Not sure what Flatpak version you're on but the expected behavior is that the install command will automatically detect that the per-user installation should be used if the specified remote exists there and only there.

This isn't documented anywhere that I could see, except here. (if it is feel free to point me there)

@rusty-snake
Copy link

rusty-snake commented May 11, 2022

man 1 flatpak-install, last paragraph of DESCRIPTION:

Unless overridden with the --user or the --installation option, this command installs the application or runtime in the default system-wide installation.

Flatpak 1.12.7

@SteveLauC
Copy link

Well, flatpak -h does not mention that the --user option can be used directly with flatpak but it actually can, so one can do the following alias:

$ alias flatpak='flatpak --user'
$ flatpak install flathub xx.xx.xx

@rusty-snake
Copy link

Now try to run flatpak ps.

@SteveLauC
Copy link

Now try to run flatpak ps.

Everything seems to be ok?

@rusty-snake
Copy link

Good for you.

$ LANG=C flatpak --user ps
error: Unknown option --user

@SteveLauC
Copy link

Good for you.

$ LANG=C flatpak --user ps

error: Unknown option --user

Kinda weird:(

@rusty-snake
Copy link

rusty-snake commented Jan 1, 2024

Expected because flatpak ps -h has no --user (ps --user do not make sense after all).

@SteveLauC
Copy link

Maybe this hack will only work in specific versions

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

7 participants