How do I install a FlatPak for a specific user?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












Let's say I'm logged on to Linux as user1 and I want to install a Flatpak to user2's account. What is the command? These do not work.



flatpak install --user user2 flathub com.skype.Client
sudo flatpak install --user user2 flathub com.skype.Client


Do I have to log on to user2's account and then issue the command



flatpak install --user flathub com.skype.Client



or is the proper command something else? The current documentations doesn't provide examples of the --user argument in use so I'm left to guess.










share|improve this question























  • @user535733 Virtually every Linux server allows for a user to become another user. There are many security configurations you can use to change which users get access to which permissions and groups, but becoming other users is a fundamental feature of Unix/Linux permissions.
    – Kristopher Ives
    1 hour ago














up vote
3
down vote

favorite












Let's say I'm logged on to Linux as user1 and I want to install a Flatpak to user2's account. What is the command? These do not work.



flatpak install --user user2 flathub com.skype.Client
sudo flatpak install --user user2 flathub com.skype.Client


Do I have to log on to user2's account and then issue the command



flatpak install --user flathub com.skype.Client



or is the proper command something else? The current documentations doesn't provide examples of the --user argument in use so I'm left to guess.










share|improve this question























  • @user535733 Virtually every Linux server allows for a user to become another user. There are many security configurations you can use to change which users get access to which permissions and groups, but becoming other users is a fundamental feature of Unix/Linux permissions.
    – Kristopher Ives
    1 hour ago












up vote
3
down vote

favorite









up vote
3
down vote

favorite











Let's say I'm logged on to Linux as user1 and I want to install a Flatpak to user2's account. What is the command? These do not work.



flatpak install --user user2 flathub com.skype.Client
sudo flatpak install --user user2 flathub com.skype.Client


Do I have to log on to user2's account and then issue the command



flatpak install --user flathub com.skype.Client



or is the proper command something else? The current documentations doesn't provide examples of the --user argument in use so I'm left to guess.










share|improve this question















Let's say I'm logged on to Linux as user1 and I want to install a Flatpak to user2's account. What is the command? These do not work.



flatpak install --user user2 flathub com.skype.Client
sudo flatpak install --user user2 flathub com.skype.Client


Do I have to log on to user2's account and then issue the command



flatpak install --user flathub com.skype.Client



or is the proper command something else? The current documentations doesn't provide examples of the --user argument in use so I'm left to guess.







software-installation flatpak






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 13 mins ago









Kristopher Ives

84649




84649










asked 2 hours ago









stackinator

358112




358112











  • @user535733 Virtually every Linux server allows for a user to become another user. There are many security configurations you can use to change which users get access to which permissions and groups, but becoming other users is a fundamental feature of Unix/Linux permissions.
    – Kristopher Ives
    1 hour ago
















  • @user535733 Virtually every Linux server allows for a user to become another user. There are many security configurations you can use to change which users get access to which permissions and groups, but becoming other users is a fundamental feature of Unix/Linux permissions.
    – Kristopher Ives
    1 hour ago















@user535733 Virtually every Linux server allows for a user to become another user. There are many security configurations you can use to change which users get access to which permissions and groups, but becoming other users is a fundamental feature of Unix/Linux permissions.
– Kristopher Ives
1 hour ago




@user535733 Virtually every Linux server allows for a user to become another user. There are many security configurations you can use to change which users get access to which permissions and groups, but becoming other users is a fundamental feature of Unix/Linux permissions.
– Kristopher Ives
1 hour ago










1 Answer
1






active

oldest

votes

















up vote
3
down vote













You can do this using the common Linux command Substitute User (su) or the Substitute User Do (sudo) command. Here are examples:



Installing a FlatPak with su



su user2 -c flatpak install --user com.skype.Client


You will be asked for the password of user2 to become that user.



Installing a FlatPak with sudo



sudo -u user2 flatpak install --user com.skype.Client


Assuming you are an admin user or a user that has "sudoer" rights, you will be asked for your password in which case you will then become user2 to run the command.



Step-by-step



You can also combine the two by becoming root first and then becoming another user:



sudo -s # you will become root
whoami # will print root
su user2 # you will become user2
whoami # will print user2
flatpak install --user com.skype.Client





share|improve this answer






















  • I should have mentioned I explicitly want to use the --user argument, so the Flatpak will only be installed on user2's account. How do you add this --user argument to your commands above? It appears your commands would install the Flatpak to all users.
    – stackinator
    1 hour ago











  • The commands are the same but simply append the --user option to the flatpak install command. The --user option specifies that the flatpak will be installed as the current user instead of for the entire system.
    – Kristopher Ives
    1 hour ago










  • @stackinator I have edited my answer to be more specific.
    – Kristopher Ives
    1 hour ago










  • may I add to use sudo -u user2 -H ? -H force the command to be run from user2 home directory and not from your directory. Maybe it's not relevant for flatpak but I've seen script fail because they try to write in the current directory and as user2 they don't have permissions to do so.
    – Marco Martinelli
    31 mins ago










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1078021%2fhow-do-i-install-a-flatpak-for-a-specific-user%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote













You can do this using the common Linux command Substitute User (su) or the Substitute User Do (sudo) command. Here are examples:



Installing a FlatPak with su



su user2 -c flatpak install --user com.skype.Client


You will be asked for the password of user2 to become that user.



Installing a FlatPak with sudo



sudo -u user2 flatpak install --user com.skype.Client


Assuming you are an admin user or a user that has "sudoer" rights, you will be asked for your password in which case you will then become user2 to run the command.



Step-by-step



You can also combine the two by becoming root first and then becoming another user:



sudo -s # you will become root
whoami # will print root
su user2 # you will become user2
whoami # will print user2
flatpak install --user com.skype.Client





share|improve this answer






















  • I should have mentioned I explicitly want to use the --user argument, so the Flatpak will only be installed on user2's account. How do you add this --user argument to your commands above? It appears your commands would install the Flatpak to all users.
    – stackinator
    1 hour ago











  • The commands are the same but simply append the --user option to the flatpak install command. The --user option specifies that the flatpak will be installed as the current user instead of for the entire system.
    – Kristopher Ives
    1 hour ago










  • @stackinator I have edited my answer to be more specific.
    – Kristopher Ives
    1 hour ago










  • may I add to use sudo -u user2 -H ? -H force the command to be run from user2 home directory and not from your directory. Maybe it's not relevant for flatpak but I've seen script fail because they try to write in the current directory and as user2 they don't have permissions to do so.
    – Marco Martinelli
    31 mins ago














up vote
3
down vote













You can do this using the common Linux command Substitute User (su) or the Substitute User Do (sudo) command. Here are examples:



Installing a FlatPak with su



su user2 -c flatpak install --user com.skype.Client


You will be asked for the password of user2 to become that user.



Installing a FlatPak with sudo



sudo -u user2 flatpak install --user com.skype.Client


Assuming you are an admin user or a user that has "sudoer" rights, you will be asked for your password in which case you will then become user2 to run the command.



Step-by-step



You can also combine the two by becoming root first and then becoming another user:



sudo -s # you will become root
whoami # will print root
su user2 # you will become user2
whoami # will print user2
flatpak install --user com.skype.Client





share|improve this answer






















  • I should have mentioned I explicitly want to use the --user argument, so the Flatpak will only be installed on user2's account. How do you add this --user argument to your commands above? It appears your commands would install the Flatpak to all users.
    – stackinator
    1 hour ago











  • The commands are the same but simply append the --user option to the flatpak install command. The --user option specifies that the flatpak will be installed as the current user instead of for the entire system.
    – Kristopher Ives
    1 hour ago










  • @stackinator I have edited my answer to be more specific.
    – Kristopher Ives
    1 hour ago










  • may I add to use sudo -u user2 -H ? -H force the command to be run from user2 home directory and not from your directory. Maybe it's not relevant for flatpak but I've seen script fail because they try to write in the current directory and as user2 they don't have permissions to do so.
    – Marco Martinelli
    31 mins ago












up vote
3
down vote










up vote
3
down vote









You can do this using the common Linux command Substitute User (su) or the Substitute User Do (sudo) command. Here are examples:



Installing a FlatPak with su



su user2 -c flatpak install --user com.skype.Client


You will be asked for the password of user2 to become that user.



Installing a FlatPak with sudo



sudo -u user2 flatpak install --user com.skype.Client


Assuming you are an admin user or a user that has "sudoer" rights, you will be asked for your password in which case you will then become user2 to run the command.



Step-by-step



You can also combine the two by becoming root first and then becoming another user:



sudo -s # you will become root
whoami # will print root
su user2 # you will become user2
whoami # will print user2
flatpak install --user com.skype.Client





share|improve this answer














You can do this using the common Linux command Substitute User (su) or the Substitute User Do (sudo) command. Here are examples:



Installing a FlatPak with su



su user2 -c flatpak install --user com.skype.Client


You will be asked for the password of user2 to become that user.



Installing a FlatPak with sudo



sudo -u user2 flatpak install --user com.skype.Client


Assuming you are an admin user or a user that has "sudoer" rights, you will be asked for your password in which case you will then become user2 to run the command.



Step-by-step



You can also combine the two by becoming root first and then becoming another user:



sudo -s # you will become root
whoami # will print root
su user2 # you will become user2
whoami # will print user2
flatpak install --user com.skype.Client






share|improve this answer














share|improve this answer



share|improve this answer








edited 1 hour ago

























answered 1 hour ago









Kristopher Ives

84649




84649











  • I should have mentioned I explicitly want to use the --user argument, so the Flatpak will only be installed on user2's account. How do you add this --user argument to your commands above? It appears your commands would install the Flatpak to all users.
    – stackinator
    1 hour ago











  • The commands are the same but simply append the --user option to the flatpak install command. The --user option specifies that the flatpak will be installed as the current user instead of for the entire system.
    – Kristopher Ives
    1 hour ago










  • @stackinator I have edited my answer to be more specific.
    – Kristopher Ives
    1 hour ago










  • may I add to use sudo -u user2 -H ? -H force the command to be run from user2 home directory and not from your directory. Maybe it's not relevant for flatpak but I've seen script fail because they try to write in the current directory and as user2 they don't have permissions to do so.
    – Marco Martinelli
    31 mins ago
















  • I should have mentioned I explicitly want to use the --user argument, so the Flatpak will only be installed on user2's account. How do you add this --user argument to your commands above? It appears your commands would install the Flatpak to all users.
    – stackinator
    1 hour ago











  • The commands are the same but simply append the --user option to the flatpak install command. The --user option specifies that the flatpak will be installed as the current user instead of for the entire system.
    – Kristopher Ives
    1 hour ago










  • @stackinator I have edited my answer to be more specific.
    – Kristopher Ives
    1 hour ago










  • may I add to use sudo -u user2 -H ? -H force the command to be run from user2 home directory and not from your directory. Maybe it's not relevant for flatpak but I've seen script fail because they try to write in the current directory and as user2 they don't have permissions to do so.
    – Marco Martinelli
    31 mins ago















I should have mentioned I explicitly want to use the --user argument, so the Flatpak will only be installed on user2's account. How do you add this --user argument to your commands above? It appears your commands would install the Flatpak to all users.
– stackinator
1 hour ago





I should have mentioned I explicitly want to use the --user argument, so the Flatpak will only be installed on user2's account. How do you add this --user argument to your commands above? It appears your commands would install the Flatpak to all users.
– stackinator
1 hour ago













The commands are the same but simply append the --user option to the flatpak install command. The --user option specifies that the flatpak will be installed as the current user instead of for the entire system.
– Kristopher Ives
1 hour ago




The commands are the same but simply append the --user option to the flatpak install command. The --user option specifies that the flatpak will be installed as the current user instead of for the entire system.
– Kristopher Ives
1 hour ago












@stackinator I have edited my answer to be more specific.
– Kristopher Ives
1 hour ago




@stackinator I have edited my answer to be more specific.
– Kristopher Ives
1 hour ago












may I add to use sudo -u user2 -H ? -H force the command to be run from user2 home directory and not from your directory. Maybe it's not relevant for flatpak but I've seen script fail because they try to write in the current directory and as user2 they don't have permissions to do so.
– Marco Martinelli
31 mins ago




may I add to use sudo -u user2 -H ? -H force the command to be run from user2 home directory and not from your directory. Maybe it's not relevant for flatpak but I've seen script fail because they try to write in the current directory and as user2 they don't have permissions to do so.
– Marco Martinelli
31 mins ago

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1078021%2fhow-do-i-install-a-flatpak-for-a-specific-user%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

List of Gilmore Girls characters

One-line joke