5

I wanted to install Android Studio. So, I followed this:

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

But then this started downloading the IDE, which I already had (from Google's official page), so I moved my IDE.zip file to the opt/ directory and ran the above commands again. But it started downloading the same file. So I exited it.

Today, when I tried installing Giggle using this,

 sudo apt-get install giggle

I am getting the following window. Trying to install Giggle

And if I press Yes, it downloads Giggle and then starts downloading the IDE all over again.

So, is there any way I can completely remove android-studio and make my terminal forget it ever happened?

I'm on Ubuntu 14.04 [64-bit].

On a side-note, is there any other way to download things other than apt-get and the Software Center?

EDIT: Added output.

lakshya@Inspiron3521:~$ cat /var/lib/dpkg/info/{giggle,android-studio}*.{post,pre}inst
cat: /var/lib/dpkg/info/giggle*.postinst: No such file or directory
cat: /var/lib/dpkg/info/giggle*.preinst: No such file or directory
cat: /var/lib/dpkg/info/android-studio*.postinst: No such file or directory
cat: /var/lib/dpkg/info/android-studio*.preinst: No such file or directory

EDIT 2: I'm getting this red sign on my menu bar now. Red sign on menu bar

EDIT 3: Result of sudo apt-get install -f sudo apt-get install -f.

lakshyaag
  • 648
  • 5
  • 14

1 Answers1

4

The main reason of your problem is the fact that, as you said, you exited before completion from the android-studio package installation. So the installation has been unsuccessful. In your case, this can be checked using the following command:

grep -A1 "Package: android-studio" /var/lib/dpkg/status

And probably the output will be something like:

Package: android-studio 
Status: install reinstreq half-installed

From this output you can understand that the package android-studio has been half-installed and now a reinstallation is required.

To fix this you could simply reinstall the package or, if you don't want, then first make a backup of the dpkg status file by issuing the following command at the terminal:

sudo cp /var/lib/dpkg/status status.bak

And then open /var/lib/dpkg/status file with the following commands in terminal:

sudo -i    #  to grant access as root
gedit /var/lib/dpkg/status

When it opens, search through the file for android-studio package and delete that entry (delete everything from the line Package: android-studio until next line that starts with Package: ...). Don't delete anything else. Save the file and close it. And in terminal type Ctrl+D to logout from the root account.

Now you should be able to install any other package without the need of android-studio.

Radu Rădeanu
  • 169,590