简体   繁体   English

ubuntu 中的 android studio 的 studio.sh 打开权限被拒绝

[英]studio.sh open permission denied for android studio in ubuntu

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.我下载了一个适用于 linux 的 Android Studio,然后尝试按照说明运行“bin”目录中的 studio.sh 文件。 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.整个 Studio 包是 .tdz 格式,我在通过终端访问之前提取了文件。 What is the main cause for such error?造成这种错误的主要原因是什么? Thank you so much!非常感谢!

Got the same problem.遇到了同样的问题。 But solved it by following steps:-但是通过以下步骤解决了它:-

  1. Right click on studio.sh and select Properties.右键单击 studio.sh 并选择属性。
  2. There go to Permissions .那里去权限
  3. Check " Allow Executing file as program "勾选“允许将文件作为程序执行

And you are done.你已经完成了。

Type类型

sudo ./studio.sh

This should launch android studio with admin privileges.这应该以管理员权限启动 android studio。 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.当它第一次启动时,它会要求你添加一个快捷方式,以便可以从 GUI 应用程序菜单中访问它。 After that, launching android studio should not require sudo permissions.之后,启动 android studio 不需要 sudo 权限。

https://askubuntu.com/questions/421389/where-to-unpack-the-android-studio-file has good recommendations of where to extract android studio to. https://askubuntu.com/questions/421389/where-to-unpack-the-android-studio-file对将 android studio 提取到的位置有很好的建议。

You've probably extracted it as root.您可能已经以 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.使用chown命令将文件的所有者更改为您并再次提取它,或者将整个提取内容的所有者更改为您。 Example (sudo may be required):示例(可能需要 sudo):

sudo chown yourUserName studio.sh

The other way to do it: change privileges with chmod另一种方法:使用 chmod 更改权限

sudo chmod a+x studio.sh

Beware, the above one gives every registered user privileges to execute studio script.请注意,上面的一个赋予每个注册用户执行工作室脚本的权限。

--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所以你将被允许安装和运行 android studio

Hope this helps :)希望这可以帮助 :)

I have the same problem, then i used我有同样的问题,然后我使用

sudo sh studio.sh 

then it`s worked.那么它的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM