Installing applications with Flatpak: with or without "sudo"?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
foersu
Level 3
Level 3
Posts: 154
Joined: Thu Mar 18, 2010 6:52 pm
Location: Kaarst, Germany

Installing applications with Flatpak: with or without "sudo"?

Post by foersu »

Hello,

when installing an application with Flakpak:
what is the difference of issuing the command with sudo or without sudo?

Code: Select all

flatpak install <remotes> <ApplicationID>
vs

Code: Select all

sudo flatpak install <remotes> <ApplicationID>
Thanx for your answers.

Regards.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
spamegg
Level 14
Level 14
Posts: 5026
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: Installing applications with Flatpak: with or without "sudo"?

Post by spamegg »

Without sudo, you will run the command as current user. With sudo, you run the command with the security privileges of root. The ownership of the installed files will belong to root, not current user, certain operations will require root permissions, and most likely it will be installed in a different location (than it would be without sudo).

However some installation commands require sudo.

Using the installed program should not be any different. Even though current user cannot change permissions of files owned by root, usually these installations will grant "Execute" permission to current user.

Either way, both approaches should be fine I think. For example apt will usually tell you to install stuff with sudo ...
foersu
Level 3
Level 3
Posts: 154
Joined: Thu Mar 18, 2010 6:52 pm
Location: Kaarst, Germany

Re: Installing applications with Flatpak: with or without "sudo"?

Post by foersu »

If I have the choice of installing a flatpak application with or without the use of sudo, and the application will practically run ok in both cases: which one of both versions would you recommend: installation with or without sudo?

Regards.

P.S.: you are right, when installing as a normal user using apt, it always requires to use sudo.
Hoser Rob
Level 20
Level 20
Posts: 11796
Joined: Sat Dec 15, 2012 8:57 am

Re: Installing applications with Flatpak: with or without "sudo"?

Post by Hoser Rob »

AFAIK flatpak apps are stored in /var/lib. That's in the root directory. You cannot write to the root directory without using a sudo or root password (BTW I've never activated the root password in Ubuntu or Mint, not needed).
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
tkocou
Level 2
Level 2
Posts: 82
Joined: Mon Jul 30, 2012 6:25 pm

Re: Installing applications with Flatpak: with or without "sudo"?

Post by tkocou »

Not sure if this will help:
I'm running the latest LM 20.1 as of this writing. When I browse the flathub repository (https://flathub.org/home) and click on an app for installation, I am presented with a dialog menu asking if I want to download the app or use the Software Manager of LM. On choosing the Software Manager (SM), the SM adds the app to itself and takes care of the necessary permissions while it installs the app.

Update: Found that the flatpak installation process has a bug in it. The software deficiency causes flatpak to not install all of the needed support files for flatpak apps found in flathub.org. The deficiency appears in both the GUI and CLI installation processes.
I have installed independent flatpak files without support problems.

Buyer beware!
Linux Mint 21.1 Cinnamon
Locked

Return to “Software & Applications”