Score:0

How to access all your installed applications from a non root user profile

de flag

I have created a non-root user profile (ubuntu 18.04) using

sudo adduser john
su - john

Now, when I want to access/open my applications which were installed as root user (for example vscode) from my non root user profile 'john'. It didn't work. Is it because all configuration files are in my root user profile or only root users can use these applications? Can't I somehow use these applications (maybe not with sudo privileges) from my 'john' profile? If yes, can someone please guide me how. If not then what is the point of making a non-root user profile?.

Also, If I can access the application, then can I edit the configurations specific to 'john' profile? I am still new to linux and learning about it. Any help would be greatly appreciated. Thank you!


Edit:
I am not able to access any of my applications. For eg: if I try opening vscode (in non-root user 'john') using

code .

It just didn't open up. Some other application like opening up (pre-installed for root user) 'simplescreenrecorder' using terminal with 'john' user gives error.

No protocol specified
qt.qpa.xcb: could not connect to display :1
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" 
even though it was found.
This application failed to start because no Qt platform plugin 
could be initialized. Reinstalling the application may fix this 
problem.

Available platform plugins are: eglfs, linuxfb, minimal, 
minimalegl, offscreen, vnc, xcb.

Aborted (core dumped)

I tried making 'john' a sudoer and even then I couldn't access my applications. I tried installing these applications in 'john' user, for eg:

sudo apt-get install simplescreenrecorder

But it is showing that it is already installed. I am more confused now. Also, is copy pasting the configuration files the way to access the applications? Can't it make the default configurations on its own or maybe somehow I can give access to root user configurations

Eagle_Mike avatar
mx flag
Each user should have their own home and therefore their own set of installed applications by default. You would not want each user to be able to access each others files.
Bodo avatar
pt flag
Please [edit] your question and add more details: What exactly means "It didn't work."? Do you get an error message? Behavior different from what you expect? How did you install the applications? Normally, i.e. when you install a Ubuntu software package, the applications should be installed for all users, but the settings are user-specific. It might be possible to copy the settings from one user to another user, but this depends on the specific application.
Mudit Goyal avatar
de flag
@Bodo I have edit the question and tried to clarified the issue I am facing. I hope this helps
Bodo avatar
pt flag
Please add the information from your comment below the answer to the question. Your use of "root user" is misleading. Describe step-by-step what you are doing. Are you logged in as user `mudit` and use `su - john` in a terminal window and then try to start a graphical application as `john`? A process running as `john` is not allowed to connect to the graphical display started as `mudit` without special measures. I suggest to log out `mudit`, log in as `john` and run the application. `apt-get` normally installs packages for all users, not for a specific user.
Score:0
cn flag
Tom

Every User gets his/her own directory under /home So, for exmample, the user "John" has his personal directory /home/john. VSCode adds configuration to /home/john, under /home/john/.vscode. You might want to have a look at https://stackoverflow.com/questions/35368889/how-can-i-export-settings

Applications can be installed in many different locations, for example in

  • /opt
  • /usr
  • /snap

The advantage of having a non-root user is, that the root user (superuser) is very very powerful, he can basically to anything. You could, with superuser privileges, for example delete your entire directory structure from the root "/" on up, effectively completely deleting your entire system. So that's why you don't want every user to be a superuser.

Now, migrating config from on user to another is very specific to the application you want to migrate. /home//.config/Code/. You could try copying that directory from your old user to your new user.

The root user has his personal directory not under /home/root, but under /root. So you might want to have a look there.

Mudit Goyal avatar
de flag
Thanks for replying. I am sorry for the confusion, I meant I have /home/mudit profile which is my default sudo profile. I have installed all my applications using that profile. Now I want to access those applications in /home/john profile. Unfortunately, neither I could access it nor install it for that profile (showing already installed). Also, I understand that sudo user has all the privileges which could be misused by someone but my doubt is that if a non-root user can't even install or access the applications then what is the point in making such profile. I hope you understand my issue now
Someone avatar
my flag
@MuditGoyal As your comment describes, you haven't installed the applications using the root user, you installed it using a system administrator profile (mudit) which is a regular user. Please edit your question and clarify which exact user you are using (your comment says you didn't use the actual root profile to install the app). To go to a root profile just run `sudo -i`... If an application is installed by a root user, anyone can access it if they have the root password, just run `sudo <app name>` for normal users, just run the CLI name of the `<app>` in a terminal.
cn flag
Tom
Thats strange, so when you cant Start vscode but when you try to install it, it gives an error telling you that its already installed? Try running the command "code" in your console, that should Start vscode. If that works, then Theres probably a .desktop Entry missing. The .desktop file tells your system where to find applications when you type them in the search bar
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.