![排除 Android studio 需要 root 权限](https://linux22.com/image/104125/%E6%8E%92%E9%99%A4%20Android%20studio%20%E9%9C%80%E8%A6%81%20root%20%E6%9D%83%E9%99%90.png)
我必须在/opt
fedora 25 中安装 Android studio。出于各种原因,我不想使用 sudo 运行它。因此,现在我没有设置 root 密码。
我不确定是否应该更改/opt
权限755
或者是否有更好的选择。
如果我尝试保护我的帐户密码并运行 Android studio,我会看到以下内容sudo
./studio.sh
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=350m; support was removed in 8.0
Looking in classpath from com.intellij.util.lang.UrlClassLoader@6d5380c2 for /com/sun/jna/linux-x86-64/libjnidispatch.so
Found library resource at jar:file:/opt/android-studio/lib/jna.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
Trying /home/user/.AndroidStudio2.2/system/tmp/jna4343912368523517735.tmp
Found jnidispatch at /home/user/.AndroidStudio2.2/system/tmp/jna4343912368523517735.tmp
[ 47553] WARN - dea.updater.SdkComponentSource - File /home/user/.android/repositories.cfg could not be loaded.
[ 47830] WARN - s.RepoProgressIndicatorAdapter - File /home/user/.android/repositories.cfg could not be loaded.
答案1
我在我的项目文件夹上运行,sudo chown -R user:user folder
该文件夹是我使用具有 root 权限的 android studio 生成的。/opt/android-studio
/root/Android/Sdk
另外,我搬到 /root/Android/Sdk
了,~/Android/Sdk
因为 android studio IDE 无法看到 SDK(如果它位于)/root
答案2
谢谢林诺布
根据您的建议和 Google 关于全新重新安装的建议,我在 ubuntu 18.04 上通过 Google 的 PPA 创建了预先安装:
sudo mkdir -p /opt/android-studio/Android
sudo mkdir /opt/android-studio/.config/Google
sudo mkdir /opt/android-studio/.local/share/Google
ln -s /opt/android-studio/Android ~/Android
ln -s /opt/android-studio/.configure/Google ~/.config/Google
ln -s /opt/android-studio/.local/share/Google ~/.local/share/Google
sudo ln -s /opt/android-studio/Android /root/Android
sudo ln -s /opt/android-studio/.configure/Google /root/.config/Google
sudo ln -s /opt/android-studio/.local/share/Google /root/.local/share/Google
安装后
sudo chown -R用户:用户/opt/android-studio