Question: I have tried for a lot times, but failed. 
**The Problem Details:** I used these commands

```
sudo apt-add-repository ppa:paolorotolo/android-studio
sudo apt-get update
sudo apt-get install android-studio  

```

When i command the first line into the terminal it didn't notice me to getting any error. But after commanding the second line it got error..
There is the screenshot of that Error ...![enter image description here](https://i.stack.imgur.com/NILHo.png)

Answer: 
The official distribution of Android Studio can be downloaded [here](http://developer.android.com/sdk/index.html). You're trying to use an unofficial repository maintained by someone from the community; there is absolutely no guarantee that it's going to work. Please consider downloading the official distribution instead.
So, first you want to make sure your Java is properly installed. You can do this manually or with a PPA.

**Manual Method:**

* Get rid of the Open JDK that may be installed:

sudo apt-get update && apt-get remove openjdk\*
* Download Oracle JDK from here. You are looking for a linux version
with tar.gz extension. Also choose the right version from 32-bit
(x86) and 64bit (x64) one.

sudo mkdir -p /opt/java
* Move the unzipped download to where it will live (I put the version
number in this example):

sudo mv jdk1.8.0\_91 /opt/java
* Make this JDK your system's default:

sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.8.0\_91/bin/java" 1

sudo update-alternatives --set java /opt/java/jdk1.8.0\_91/bin/java
* Finally, test your Java version:

java -version

**PPA Method:**

* Get rid of the Open JDK that may be installed:

sudo apt-get update && apt-get remove openjdk\*

* ADD PPA

sudo add-apt-repository ppa:webupd8team/java

* UPDATE

sudo apt-get update

* INSTALL

sudo apt-get install oracle-java8-installer

**Now Install Android Studio - either manually or via PPA:**

**Manual Method:**

* Download android studio:

Get it from <http://developer.android.com/sdk/installing/studio.html#download> then untar it under /opt/android-studio (recommended). 

* Launch it!

run ./studio.sh in the /opt/android-studio/bin directory. This will launch the setup and download all the SDKs and other necessary files on your first run, and this is what you will do to launch in the future. Just make a shortcut :)

**PPA Method:**

* ADD PPA

sudo add-apt-repository ppa:paolorotolo/android-studio

* UPDATE

sudo apt-get update

* INSTALL

sudo apt-get install android-studio

**NOTE:** This PPA is maintained by Google, not just "someone from the community"