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
    Re: side-note: Yes. Open a browser (Firefox comes pre-installed) and download. – muru Feb 10 '15 at 09:32
  • If I download something via the browser, it gives me .tar.gz file and I cannot figure out how to install them. I try using `make` and I always get an error. – lakshyaag Feb 10 '15 at 09:38
  • If it helps, whenever I try downloading something, I always get android-studio in the update category, never in the install category. – lakshyaag Feb 10 '15 at 09:39
  • @muru, apt-get did not install giggle, it just downloaded it and went right to download the IDE. – lakshyaag Feb 10 '15 at 10:02
  • Giggle depends on android-studio? I don't think so because when I try installing `nethogs`, I get the same error – lakshyaag Feb 10 '15 at 10:08
  • @muru, [Trying to install `nethogs`](http://i.imgur.com/9dcXGVb.png) – lakshyaag Feb 10 '15 at 10:15
  • @Radu, android-studio isn't a dependency, apt is trying to update it. I wan't to stop that from happening. – lakshyaag Feb 10 '15 at 10:18
  • What if you remove the PPA? http://askubuntu.com/a/310/158442? – muru Feb 10 '15 at 10:19
  • @muru, [Result of removing PPA](http://i.imgur.com/M75tlhH.png) – lakshyaag Feb 10 '15 at 10:30
  • @Radu, I tried putting android-studio on hold, but now when I try installing I get `E: Can't find a source to download version '4.7-0ubuntu0' of 'android-studio:amd64'` – lakshyaag Feb 10 '15 at 10:42
  • 1
    @XZYoda12 What is the output of `grep -A1 "Package: android-studio" /var/lib/dpkg/status` ? – Radu Rădeanu Feb 10 '15 at 10:58
  • 1
    @Radu, `lakshya@Inspiron3521:~$ grep -A1 "Package: android-studio" /var/lib/dpkg/status Package: android-studio Status: install reinstreq half-installed` – lakshyaag Feb 10 '15 at 11:24
  • 1
    Ok, then open as root this file: `/var/lib/dpkg/status` and delete all the content referring to `android-studio` package. – Radu Rădeanu Feb 10 '15 at 13:03
  • That did it. Now I can install things easily. Thanks a lot. Could you post it as an answer so I can mark it accepted? Again, thanks a lot. – lakshyaag Feb 10 '15 at 13:17

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
  • 166,822
  • 48
  • 327
  • 400