I am trying to update Java on my Ubuntu server to Java 8, but I get an error message and Java wont update.
error message: Errors where encountered while processing E: Sub-process /usr/bin/dpkg returned an error code (1)
I used:
sudo add-apt-repository ppa:webupd8team/java
Then:
sudo apt update
Gave error:
Failed to fetch ......binary-amd64/Packages 404 not found
Failed to fetch ......binary-i386/Packages 404 not found
E: some files failed to download. Thay have been ignored,or old ones used instead.
Then:
sudo apt install oracle-java8-installer
Gave error:
E: Sub-process /usr/bin/dpkg returned an error code (1)
I also tried sudo apt-get -f install
and it gave this output:
Debconf : DbDriver "config" : /var/cache/deconf/config.dat is locked by another process: resource temorarily unavalable
Dpkg: error processing pacage openssh-server (--configure):
Subprocess installed post-instalation script returned error exit status 2
Errors were encountered while processing:
openssh-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have not used my 16.10 server for a year and it has not been updated in 2 years.
I used sudo apt-get update
and got this output:
sijmen@dell:~$ sudo apt-get update
[sudo] password for sijmen:
Ign http: //ppa.launchpad.net trusty InRelease
Ign http: //ppa.launchpad.net trusty Release.gpg
Ign http: //ppa.launchpad.net trusty Release
Err http: //ppa.launchpad.net trusty/main amd64 Packages
404 Not Found
Err http: //ppa.launchpad.net trusty/main i386 Packages
404 Not Found
Ign http: //ppa.launchpad.net trusty/main Translation-en
W: Failed to fetch http:
/ppa.launchpad.net/thefrontiergroup/vsftpd/ubuntu/dists/trusty/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http:
/ppa.launchpad.net/thefrontiergroup/vsftpd/ubuntu/dists/trusty/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Then I ran sudo apt-get install oracle-java-8-installer
and it gave this output:
sijmen@dell:~$ sijmen@dell:~$ sudo apt-get install oracle-java-8-installer
WARNING:root:could not open file '/etc/apt/sources.list'
sijmen@dell:~$: command not found
sijmen@dell:~$ [sudo] password for sijmen:
WARNING:root:could not open file '/etc/apt/sources.list'
[sudo]: command not found
sijmen@dell:~$ Reading package lists... Done
WARNING:root:could not open file '/etc/apt/sources.list'
Reading: command not found
sijmen@dell:~$ Building dependency tree
WARNING:root:could not open file '/etc/apt/sources.list'
Building: command not found
sijmen@dell:~$ Reading state information... Done
WARNING:root:could not open file '/etc/apt/sources.list'
Reading: command not found
sijmen@dell:~$ E: Unable to locate package oracle-java-8-installer
WARN
E:: command not found
Then I ran sudo apt-add-repository --remove ppa:webupd8team/java
and got this output.
sijmen@dell:~$ sijmen@dell:~$ sudo apt-get install oracle-java-8-installer
WARNING:root:could not open file '/etc/apt/sources.list'
sijmen@dell:~$: command not found
sijmen@dell:~$ [sudo] password for sijmen:
WARNING:root:could not open file '/etc/apt/sources.list'
[sudo]: command not found
sijmen@dell:~$ Reading package lists... Done
WARNING:root:could not open file '/etc/apt/sources.list'
Reading: command not found
sijmen@dell:~$ Building dependency tree
WARNING:root:could not open file '/etc/apt/sources.list'
Building: command not found
sijmen@dell:~$ Reading state information... Done
WARNING:root:could not open file '/etc/apt/sources.list'
Reading: command not found
sijmen@dell:~$ E: Unable to locate package oracle-java-8-installer
WARNING:root:could not open file '/etc/apt/sources.list'
E:: command not found
sijmen@dell:~$ sudo apt-add-repository --remove ppa:webupd8team/java
WARNING:root:could not open file '/etc/apt/sources.list'
WARNING:root:could not open file '/etc/apt/sources.list'
Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK7 / JDK8 / JDK9). There are no actual Java files in this PPA.
Important -> Why Oracle Java 7 And 6 Installers No Longer Work: http://www.webupd8.org/2017/06/why-oracle-java-7-and- 6-installers-no.html
Ubuntu 16.10 Yakkety Yak is no longer supported by Canonical (and thus, Launchpad and this PPA). The PPA supports Ubuntu 17.10, 17.04, 16.04, 14.04 and 12.04.
More info (and Ubuntu installation instructions):
- for Oracle Java 7: http: //www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
- for Oracle Java 8: http: //www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html
Debian installation instructions:
- Oracle Java 7: http: //www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html
- Oracle Java 8: http: //www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html
Oracle Java 9 (for both Ubuntu and Debian): http://www.webupd8.org/2015/02/install-oracle-java-9-in-ubuntu-linux.html
Oracle JDK 9 is now considered stable. There are currently only 64bit builds (no other builds are available for download: http: //www.oracle.com/technetwork/java/javase/downloads/index.html )
More info: https://launchpad.net/~webupd8team/+archive/ubuntu/java
Press [ENTER] to continue or ctrl-c to cancel removing it
WARNING:root:could not open file '/etc/apt/sources.list'
WARNING:root:could not open file '/etc/apt/sources.list'
WARNI NG:root:could not open file '/etc/apt/sources.list'
WARNING:root:could not open file '/etc/apt/sources.list'
WARNING:root:could not open file '/etc/apt/sources.list'
WARNING:root:could not open file '/etc/apt/sources.list'
Then I ran sudo apt-get update
and it gave this output:
sijmen@dell:~$ sudo apt-get update
Ign http: //ppa.launchpad.net trusty InRelease
Ign http: //ppa.launchpad.net trusty Release.gpg
Ign http: //ppa.launchpad.net trusty Release
Err http: //ppa.launchpad.net trusty/main amd64 Packages
404 Not Found
Err http: //ppa.launchpad.net trusty/main i386 Packages
404 Not Found
Ign http: //ppa.launchpad.net trusty/main Translation-en
W: Failed to fetch http: //ppa.launchpad.net/thefrontiergroup/vsftpd/ubuntu/dists/trusty/main/binary-amd64/Packages 404 Not Found
W: Failed to fetch http: //ppa.launchpad.net/thefrontiergroup/vsftpd/ubuntu/dists/trusty/main/binary-i386/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Then I ran sudo apt-get install openjdk-8-jdk
and it gave this output:
sijmen@dell:~$ sudo apt-get install openjdk-8-jdk
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openjdk-8-jdk
also for the current java version:
sijmen@dell:~$ java -version
java version "1.7.0_76"
Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)