3

I downloaded an Android Studio for linux and then tried to run the studio.sh file inside the 'bin' directory as per the instruction said. The terminal showed an error saying something like this:

bash: ./studio.sh: permission denied

The whole Studio bundle was in .tdz format and I extracted the files before accessing via the terminal. What is the main cause for such error? Thank you so much!

5 Answers 5

9

Got the same problem. But solved it by following steps:-

  1. Right click on studio.sh and select Properties.
  2. There go to Permissions.
  3. Check "Allow Executing file as program"

And you are done.

1
  • When I went to permissions of studio.sh it said permissions of studio.sh could not be determined. Any ideas how to fix that?
    – Gaurav
    Commented Dec 23, 2016 at 7:09
3

Type

sudo ./studio.sh

This should launch android studio with admin privileges. You will need to type your password, assuming you have admin privileges. If you do not have them, you need to contact whoever manages the computer.

When it launches for the first time, it will ask yo to add a shortcut so it is reachable from the GUI app menu. After that, launching android studio should not require sudo permissions.

https://askubuntu.com/questions/421389/where-to-unpack-the-android-studio-file has good recommendations of where to extract android studio to.

1

You've probably extracted it as root. Change the owner of the file to you with chown command and extract it again, or change the owner of the whole extracted content to you. Example (sudo may be required):

sudo chown yourUserName studio.sh

The other way to do it: change privileges with chmod

sudo chmod a+x studio.sh

Beware, the above one gives every registered user privileges to execute studio script.

1
  • Extracted with normal user, .sh files just lack the +x. The problem is poor packaging from Google. Commented Jun 15, 2016 at 11:46
0

--make this--

sudo chown root:YOURUSERHERE /dev/kvm

sudo chmod -R 770 /dev/kvm

so you will be allowed to install and run android studio

Hope this helps :)

0

I have the same problem, then i used

sudo sh studio.sh 

then it`s worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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