successful installing packages but dpkg has error

7,222

Solution 1

  1. I download kerio-control-vpnclient-8.3.2-2261-linux.deb from Kerio Download Center, (First you must choose Kerio Control and then choose the latest version and press show file button. In this state download your own version, my version is Linux (DEB))
  2. After Downloading the Kerio package Download the related documentation. (my doc is README file for Kerio VPN Client - Linux (DEB)) And follow the documentation file.
  3. After them, you can use Kerio VPN Client Linux Ubuntu/Debian for download any banned packages.
  4. Use the below codes for installing Oracle Java 8

    $ sudo add-apt-repository ppa:webupd8team/java

    $ sudo apt-get update

    $ sudo apt-get install oracle-java8-installer

  5. Congratulation!

Solution 2

There is nothing wrong with your Ubuntu. The Oracle server is replying 403 Forbidden. The installer is attempting to download from Oracle's servers, which block you because you are in Iran which is subject to U.S. export restrictions. You will need to download the file from another server or country, or use a proxy like Tor to obscure your IP address.

If you have already installed Java, and just want to remove the Ubuntu packages, do:

$ sudo dpkg -P oracle-java-*
Share:
7,222

Related videos on Youtube

AmerllicA
Author by

AmerllicA

I'm a Frontend Engineer in a country under US economic sanction, I cannot earn like other developers in the world, I cannot have a Master or Visa card or even PayPal, applying from Stack Overflow for Job Opportunities will be banned because my country is in the Black list for every action. I cannot use Upwork, LinkedIn premium features, or any website you think. Donation crypto wallet, USDT (TRC20 network): TJJUKR9LSsU5j4rE9J9nZxJxQypoLWkaC4

Updated on September 18, 2022

Comments

  • AmerllicA
    AmerllicA over 1 year

    happy Ramadan

    I'm live in Iran and Some corporation ban us like ORACLE

    so I installed Oracle Java SDK 8 manually and after it my "dpkg" has been showing error always.

    no different between installation packages. each packages from "Ubuntu Software Center" or "apt-get" install successfully but some error has been shown and I'm very confused and angry

    somebody tell me what's wrong in my Ubuntu?

    the error is:

    Package Operation Failed
    The  installation or removal of a software package failed
    ------------------------------------------------------------------
    Details
    ------------------------------------------------------------------
    installArchives() failed: Selecting previously unselected package gnome-hearts.
    (Reading database ... 
    (Reading database ... 5%
    (Reading database ... 10%
    (Reading database ... 15%
    (Reading database ... 20%
    (Reading database ... 25%
    (Reading database ... 30%
    (Reading database ... 35%
    (Reading database ... 40%
    (Reading database ... 45%
    (Reading database ... 50%
    (Reading database ... 55%
    (Reading database ... 60%
    (Reading database ... 65%
    (Reading database ... 70%
    (Reading database ... 75%
    (Reading database ... 80%
    (Reading database ... 85%
    (Reading database ... 90%
    (Reading database ... 95%
    (Reading database ... 100%
    (Reading database ... 238764 files and directories currently installed.)
    Preparing to unpack .../gnome-hearts_0.3-2.1ubuntu1_amd64.deb ...
    Unpacking gnome-hearts (0.3-2.1ubuntu1) ...
    Processing triggers for man-db (2.6.7.1-1) ...
    Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
    Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
    Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
    Rebuilding /usr/share/applications/bamf-2.index...
    Processing triggers for mime-support (3.54ubuntu1) ...
    Setting up oracle-java7-installer (7u60-0~webupd8~0) ...
    Downloading Oracle Java 7...
    --2014-07-15 14:57:49--  http://download.oracle.com/otn-pub/java/jdk/7u60-b19/jdk-7u60-linux-x64.tar.gz
    Resolving download.oracle.com (download.oracle.com)... 82.178.158.11, 82.178.158.24
    Connecting to download.oracle.com (download.oracle.com)|82.178.158.11|:80... connected.
    HTTP request sent, awaiting response... 403 Forbidden
    2014-07-15 14:57:51 ERROR 403: Forbidden.
    
    download failed
    Oracle JDK 7 is NOT installed.
    dpkg: error processing package oracle-java7-installer (--configure):
     subprocess installed post-installation script returned error exit status 1
    Setting up oracle-java8-installer (8u5-1~webupd8~3) ...
    Downloading Oracle Java 8...
    --2014-07-15 14:57:52--  http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.tar.gz
    Resolving download.oracle.com (download.oracle.com)... 82.178.158.24, 82.178.158.11
    Connecting to download.oracle.com (download.oracle.com)|82.178.158.24|:80... connected.
    HTTP request sent, awaiting response... 403 Forbidden
    2014-07-15 14:57:52 ERROR 403: Forbidden.
    
    download failed
    Oracle JDK 8 is NOT installed.
    dpkg: error processing package oracle-java8-installer (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of oracle-java8-set-default:
     oracle-java8-set-default depends on oracle-java8-installer; however:
      Package oracle-java8-installer is not configured yet.
    
    dpkg: error processing package oracle-java8-set-default (--configure):
     dependency problems - leaving unconfigured
    Setting up gnome-hearts (0.3-2.1ubuntu1) ...
    No apport report written because the error message indicates its a followup error from a previous failure.
    Processing triggers for python-support (1.0.15) ...
    Errors were encountered while processing:
     oracle-java7-installer
     oracle-java8-installer
     oracle-java8-set-default
    Error in function: 
    Setting up oracle-java7-installer (7u60-0~webupd8~0) ...
    Downloading Oracle Java 7...
    --2014-07-15 14:57:55--  http://download.oracle.com/otn-pub/java/jdk/7u60-b19/jdk-7u60-linux-x64.tar.gz
    Resolving download.oracle.com (download.oracle.com)... 82.178.158.11, 82.178.158.24
    Connecting to download.oracle.com (download.oracle.com)|82.178.158.11|:80... connected.
    HTTP request sent, awaiting response... 403 Forbidden
    2014-07-15 14:57:57 ERROR 403: Forbidden.
    
    download failed
    Oracle JDK 7 is NOT installed.
    dpkg: error processing package oracle-java7-installer (--configure):
     subprocess installed post-installation script returned error exit status 1
    Setting up oracle-java8-installer (8u5-1~webupd8~3) ...
    Downloading Oracle Java 8...
    --2014-07-15 14:57:58--  http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.tar.gz
    Resolving download.oracle.com (download.oracle.com)... 82.178.158.24, 82.178.158.11
    Connecting to download.oracle.com (download.oracle.com)|82.178.158.24|:80... connected.
    HTTP request sent, awaiting response... 403 Forbidden
    2014-07-15 14:57:58 ERROR 403: Forbidden.
    
    download failed
    Oracle JDK 8 is NOT installed.
    dpkg: error processing package oracle-java8-installer (--configure):
     subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of oracle-java8-set-default:
     oracle-java8-set-default depends on oracle-java8-installer; however:
      Package oracle-java8-installer is not configured yet.
    
    dpkg: error processing package oracle-java8-set-default (--configure):
     dependency problems - leaving unconfigured
    
    • kenn
      kenn almost 10 years
      you must provide more info. Which command did you issue to install oracle and which ppa do you use to install it. I don't think you are banned. There are dozens of ubuntu servers around the world. To temporarily fix packages integrity run sudo dpkg --configure -a sudo apt-get install -f
    • AmerllicA
      AmerllicA almost 10 years
      this is my commands: $ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get install oracle-java8-installer i'm in iran and iranians were banned from oracle, don't doubt it !
    • kenn
      kenn almost 10 years
      Hmm, you use ppa:webupd8team/java but it appears that it attemps to download archives from Oracle's servers. So, yes you are banned.
    • AmerllicA
      AmerllicA almost 10 years
      and what should i do?
    • kenn
      kenn almost 10 years
      setting proxy may be of help. Look at here askubuntu.com/questions/158557/setting-proxy-from-terminal
    • kenn
      kenn almost 10 years
      try this sudo http_proxy=81.89.96.89 apt-get install oracle-java8-installer
    • AmerllicA
      AmerllicA almost 10 years
      In my country all of proxy servers has been banned, I use Kerio VPN Client for Ubuntu and SOLVED my problem.
  • AmerllicA
    AmerllicA almost 10 years
    I run your code but return this error:
  • AmerllicA
    AmerllicA almost 10 years
    remember:I downloaded jdk-8u5-linux-x64.tar.gz from a university server and install oracle manually in /usr/lib/jvm/java-8-oracle and then run some command that post them in next comment. but after them the Ubuntu Software Center return the above error, why?!!!!!!!!!!! x-(
  • bain
    bain almost 10 years
    @user305703 What was the error from dpkg -P oracle-java*?
  • AmerllicA
    AmerllicA almost 10 years
    Never mind, I SOLVED my problem in my own way. thanks