1

You see, I have xampp, Android SDK installed in /opt/ directory as root. Now, the problem is, this machine is being used by 2 people (my sister and me) and even she uses them both. The problem arises when she uses Android Studio from her account. She gets these "Permission denied" errors when building the app or debugging it.

My account, on the other hand, has no problem in using Android Studio as the owner of /opt/Android/* is me ( drwxr-xr-x 10 suryateja suryateja 4096 May 20 23:05 Sdk ).

Hence, I was thinking of creating a group so as to enable all the users IN THIS GROUP to access all these "Permission denied" type files/directories.

Is this possible? If so, can anyone help me regarding this?
Thank you!

  • 1
    First, when you installed Android Studio as root, why is /opt/android/* not owned by root? Second, users of any program should not be writing to the installation folders. Users should have their own config and data folders for each program under /home/userid/something. Your installation is not right. See ubuntuhandbook.org/index.php/2014/11/… for installing android studio properly. – user68186 May 21 '15 at 3:01
  • Well, I did install the SDK as root. But when I started facing issues, I changed the owner to my account. But in Windows, unless specified, any user can run the programs installed in Program Files right? Can't we implement that method in Ubuntu? – Surya Teja Karra May 21 '15 at 3:05
  • 1
    Messing with the ownership of folders in /opt/* caused the problem. The purpose of installing programs using sudo (as root) is so that all users can use them. Always use the Ubuntu Software Center (the first choice) or PPAs (as shown in the link above) to install programs. This is not Windows, don't download and try to install programs by yourself until you understand the way Ubuntu works better. – user68186 May 21 '15 at 3:12
1

First, the comments from @user68186 are totally right and you probably should do it in the right way. But to answer you:

create a new group

sudo groupadd androidStudio

Now add your user and your sister user to this group

sudo usermod -a -G androidStudio  suryateja

do same as above for your sister username.

Now you should change the group ownership of /opt/Android to the newly created group

sudo chgrp {-R} [group] [file|directory]

so for you

sudo chgrp -R androidStudio /opt/Android/
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.