Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: braindamaged package causing apt-get/dpkg errors

  1. #1
    Join Date
    Apr 2012
    Location
    Phoenix, Arizona
    Beans
    166
    Distro
    Ubuntu 12.04 Precise Pangolin

    braindamaged package causing apt-get/dpkg errors

    Ok, so I was stupid. I added a ppa and attempted to install a package that wasn't correctly made, and now I get errors every time I do ANY package management function.

    I started the problem by typing these commands:
    Code:
    sudo add-apt-repository ppa:eugenesan/java
    sudo apt-get update 
    sudo apt-get install oracle-java7-installer
    What seems to happen is that the package installs, then has a post-install or configuration script that tries to download the java installer from Oracle and run it, but the script fails because the installer doesn't download correctly (or something, the checksum doesn't match).

    As a side note, if I had known that the package was just going to get the installer from Oracle, I would have gone and gotten it directly.

    Anyway, now the package is left in a "half configured" state, according to dpkg --audit, and no matter what I try to do with it (configure, remove, etc.) it just runs the same script again and fails the same way. apt-get detects and complains about this problem every time I try to do anything, like install an unrelated package via Software Center. So every operation looks like a failure, even if it succeeds.

    How do I do surgery on my system to remove this broken package? I have searched and not yet found a way to remove a half-configured package or get it out of the half-configured state.

    Below is the errors it gets when I try to remove it:
    Code:
    trask@reptoid:~$ sudo apt-get purge oracle-java7-installer
    [sudo] password for trask: 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages will be REMOVED:
      oracle-java7-installer*
    0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
    1 not fully installed or removed.
    After this operation, 82.9 kB disk space will be freed.
    Do you want to continue [Y/n]? Y
    (Reading database ... 171317 files and directories currently installed.)
    Removing oracle-java7-installer ...
    update-alternatives: error: unknown argument `bootinfoscript'
    dpkg: error processing oracle-java7-installer (--purge):
     subprocess installed pre-removal script returned error exit status 2
    Downloading...
    --2012-04-25 17:47:40--  http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz
    Resolving download.oracle.com (download.oracle.com)... 98.174.31.138, 98.174.31.91
    Connecting to download.oracle.com (download.oracle.com)|98.174.31.138|:80... connected.
    HTTP request sent, awaiting response... 302 Moved Temporarily
    Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz [following]
    --2012-04-25 17:47:40--  https://edelivery.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-x64.tar.gz
    Resolving edelivery.oracle.com (edelivery.oracle.com)... 184.51.30.174
    Connecting to edelivery.oracle.com (edelivery.oracle.com)|184.51.30.174|:443... connected.
    HTTP request sent, awaiting response... 302 Moved Temporarily
    Location: http://download.oracle.com/errors/download-fail-1505220.html [following]
    --2012-04-25 17:47:41--  http://download.oracle.com/errors/download-fail-1505220.html
    Connecting to download.oracle.com (download.oracle.com)|98.174.31.138|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 5307 (5.2K) [text/html]
    Saving to: `./jdk-7u3-linux-x64.tar.gz'
    
         0K .....                                                 100% 8.01M=0.001s
    
    2012-04-25 17:47:41 (8.01 MB/s) - `./jdk-7u3-linux-x64.tar.gz' saved [5307/5307]
    
    Download done.
    sha256sum mismatch jdk-7u3-linux-x64.tar.gz
    Oracle JDK 7 is NOT installed.
    dpkg: error while cleaning up:
     subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
     oracle-java7-installer
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    trask@reptoid:~$
    Last edited by strask; April 26th, 2012 at 01:49 AM. Reason: Added error sample.

  2. #2
    Join Date
    Apr 2012
    Location
    Phoenix, Arizona
    Beans
    166
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: braindamaged package causing apt-get/dpkg errors

    Solution, dangerous but worked for me:

    Run the following to find all the files that were installed:
    dpkg --listfiles
    Then delete each one

    Edit the file /var/lib/dpkg/status
    Remove the section for your badly broken package (Make a backup before you edit the file!)

    Edit the file /var/lib/dpkg/available
    Remove the section for your badly broken package (Make a backup before you edit the file!)

    Found this solution at http://linux.chrissweeney.co.uk/topic.php?t=18

  3. #3
    Join Date
    Apr 2012
    Beans
    322

    Re: braindamaged package causing apt-get/dpkg errors

    Oh you don't want to use that PPA. That one looked kinda shady, imho. Use this one instead:

    Code:
    sudo add-apt-repository ppa:webupd8team/java 
    sudo apt-get update 
    sudo apt-get install oracle-jdk7-installer
    But then again, they are recommending the OpenJDK 7 since it is essentially the same now after Oracle pulled the plug a few months ago with Ubuntu. And OpenJDK is in the Ubuntu repositories which makes it a breeze to install it on 12.04 LTS.

    I mean, unless you are running something like Minecraft that explicitly requires Sun Java not OpenJDK, you don't need it.

    Quote Originally Posted by strask View Post
    Solution, dangerous but worked for me:

    Run the following to find all the files that were installed:
    dpkg --listfiles
    Then delete each one

    Edit the file /var/lib/dpkg/status
    Remove the section for your badly broken package (Make a backup before you edit the file!)

    Edit the file /var/lib/dpkg/available
    Remove the section for your badly broken package (Make a backup before you edit the file!)

    Found this solution at http://linux.chrissweeney.co.uk/topic.php?t=18
    Last edited by techsupport; April 26th, 2012 at 05:24 AM.

  4. #4
    Join Date
    Apr 2012
    Location
    Phoenix, Arizona
    Beans
    166
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: braindamaged package causing apt-get/dpkg errors

    Quote Originally Posted by techsupport View Post
    Oh you don't want to use that PPA. That one looked kinda shady, imho. Use this one instead:
    Meh. Now that I understand that the package just downloads the oracle installer and runs it, I might as well just do that myself, directly.

    But then again, they are recommending the OpenJDK 7 since it is essentially the same now after Oracle pulled the plug a few months ago with Ubuntu. And OpenJDK is in the Ubuntu repositories which makes it a breeze to install it on 12.04 LTS.

    I mean, unless you are running something like Minecraft that explicitly requires Sun Java not OpenJDK, you don't need it.
    That's all very true.

  5. #5
    Join Date
    Jul 2008
    Location
    The Left Coast of the USA
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: braindamaged package causing apt-get/dpkg errors

    Quote Originally Posted by techsupport View Post
    Oracle pulled the plug a few months ago with Ubuntu. And OpenJDK is in the Ubuntu repositories which makes it a breeze to install it on 12.04 LTS.
    Oracle pulled the plug on everyone, not just Ubuntu.

    The problem with OpenJDK 7 is that even though it is the reference implementation for Java 7, most of the world does not realize that or recognize it as "Java". There is more in the world that will not run with OpenJDK than what will.

    Hopefully this will be rectified shortly as the world realizes this fact.

    Quote Originally Posted by strask View Post
    Meh. Now that I understand that the package just downloads the oracle installer and runs it, I might as well just do that myself, directly.
    The problem with that is that every time there is a Java update, you will have to reinstall it yourself, directly.

    The installer package from the webupd8team PPA (which actually works properly) will do that automatically during your normal updates when there is a new Java version available.
    Last edited by QIII; April 26th, 2012 at 07:16 AM.

  6. #6
    Join Date
    Feb 2011
    Beans
    493
    Distro
    Ubuntu

    Re: braindamaged package causing apt-get/dpkg errors

    Quote Originally Posted by techsupport View Post
    Oh you don't want to use that PPA. That one looked kinda shady, imho. Use this one instead:

    Code:
    sudo add-apt-repository ppa:webupd8team/java 
    sudo apt-get update 
    sudo apt-get install oracle-jdk7-installer
    Quote Originally Posted by QIII View Post
    The problem with that is that every time there is a Java update, you will have to reinstall it yourself, directly.

    The installer package from the webupd8team PPA (which actually works properly) will do that automatically during your normal updates when there is a new Java version available.
    Just to double check... The webupd8 ppa works with 12.04, right?

  7. #7
    Join Date
    Jun 2011
    Beans
    2

    Re: braindamaged package causing apt-get/dpkg errors

    I am getting a bunch of error while trying to install.

    Followed the directions above and got"

    sha256sum mismatch jdk-7u3-linux-x64.tar.gz
    Oracle JDK 7 is NOT installed.
    dpkg: error processing oracle-java7-installer (--configure):
    subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of oracle-jdk7-installer:
    oracle-jdk7-installer depends on oracle-java7-installer; however:
    Package oracle-java7-installer is not configured yet.
    dpkg: error processing oracle-jdk7-installer (--configure):
    dependency problems - leaving unconfigured
    No apport report written because the error message indicates its a followup error from a previous failure.
    Errors were encountered while processing:
    oracle-java7-installer
    oracle-jdk7-installer


    I suspecty there are multiple things that need to get untangled and start again.

    Suggestions?

    Thanks

  8. #8
    Join Date
    Apr 2012
    Location
    Phoenix, Arizona
    Beans
    166
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: braindamaged package causing apt-get/dpkg errors

    Quote Originally Posted by jafrelin View Post
    I am getting a bunch of error while trying to install.

    Followed the directions above and got"
    Hmm... *which* directions above did you follow already? Did you try to install from the eugenesan ppa, which is broken? Or did you try to install from the webupd8 ppa which people claim works?

    Either way, I think at this point you probably need to follow the steps in the second post in this thread; I'll repeat them here:

    Solution, dangerous but worked for me:

    Run the following to find all the files that were installed:
    Code:
    sudo dpkg --listfiles  oracle-jdk7-installer
    Then delete each one -- NOTE: Some of the items listed will be directories that contain more than just the package files; delete the individual listed files first and then delete directories only if they are empty!

    Edit the file /var/lib/dpkg/status
    Remove the section for your badly broken package (Make a backup before you edit the file!)

    Edit the file /var/lib/dpkg/available
    Remove the section for your badly broken package (Make a backup before you edit the file!)

    Finally, remember to remove the broken ppa from your configuration, I find it easiest to do this via the Software Sources gui.
    Last edited by strask; May 9th, 2012 at 07:37 PM.

  9. #9
    Join Date
    Dec 2008
    Beans
    5

    Wink Re: braindamaged package causing apt-get/dpkg errors

    Thanks perfect- I usually hate to do the most dangerous things

  10. #10
    Join Date
    Dec 2011
    Beans
    1

    Re: braindamaged package causing apt-get/dpkg errors

    I know this thread is closed but I wanted to simply say thanks. I made the same mistake - I used the same ppa and got the exact same errors. ended up going the download, tar, and install route to get around it. "Please note, this package does not contain any files. It contains a script to download the file from Oracle."

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •