27

I am using android studio 3.4.2. When I try to update the android studio it says

"Studio does not have write access to /app/extra. Please Run it by a privileged user to update"

How to solve it?

enter image description here

Mir Rahed Uddin
  • 1,208
  • 2
  • 12
  • 25

8 Answers8

36

I would suggest to set your current user as owner of /usr/bin/android-studio

This will resolve the issue in long term:

sudo chown -R $USER:$USER /usr/bin/android-studio
Samuil Banti
  • 1,735
  • 1
  • 15
  • 26
  • 5
    in my case android studio is installet in opt dir so I had to use `sudo chown -R $USER:$USER /opt/android-studio-2021.1.1` and `sudo chown -R $USER:$USER /opt/android-studio` – Genes Apr 19 '22 at 04:38
20

I would suggest setting up your current user as the owner of Android Studio

Linux

sudo chown -R $USER:$USER /usr/bin/android-studio

Mac

sudo chown -R $USER /Applications/Android\ Studio.app

or if you using android studio portable then you can use custom path like this.

sudo chown -R $USER: pathDirOfYourAndroidStudio/Android\ Studio\ Preview.app
Muhammad Numan
  • 23,222
  • 6
  • 63
  • 80
15

Navigate to your Android studio folder via terminal then run android studio with administrator privileges, using sudo or su. If you provide more information, like which OS you are using, maybe I'll be able to tell you the exactly command line you should use.

Edit:

  1. Open terminal application, then type de following : cd ~/android-studio/bin *

  2. Now we must run Android Studio script file studio.sh as administrator:

sudo ./studio.sh

If doesn't work try : sudo sh studio.sh

  1. (Optional) To prevent this problem every time you want update android studio, see https://stackoverflow.com/a/37704528/8513494

And is it.

  • I'm assuming that your android studio is located on your user folder, if there's a problem with this step, you should check /opt/ directory and look out for android studio installation folder or see https://superuser.com/a/1080329
Daniel Gunna
  • 327
  • 2
  • 8
8

For linux mint 20:

sudo chown -R $USER:$USER /opt/android-studio-4.2/android-studio/

Roy O'Bannon
  • 179
  • 1
  • 9
5

Happens on Mac when you do not have Android studio in /Application directory. Move it there, if it is not resolved, try this answer.

Rasto
  • 17,204
  • 47
  • 154
  • 245
4

enter image description here

Set access to Read and Write (default is Read only)

Rustam
  • 81
  • 6
3

I'd suggest changing the owner of the android-studio directory, doing so depends on the path of your android studio. Here is mine

sudo chown -R $USER:$USER /opt/android-studio

But you might have the following path

sudo chown -R $USER:$USER /usr/bin/android-studio

Check well and enjoy

Mistico
  • 231
  • 3
  • 4
2

If you are a MAC user and running portable AS then the simple solution is to move the application within Application folder. Check this video. It solves my issue after wasting 3 hrs within the terminal but nothing is wasting of time. I am running MACOS 13(Ventura) & AS Electric Ele.

Subho
  • 539
  • 1
  • 9
  • 25