Estou tentando atualizar o Java no meu servidor Ubuntu para o Java 8, mas recebo uma mensagem de erro e o Java não atualiza.
error message: Errors where encountered while processing E: Sub-process /usr/bin/dpkg returned an error code (1)
Eu usei:
sudo add-apt-repository ppa:webupd8team/java
Então:
sudo apt update
Deu erro:
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.
Então:
sudo apt install oracle-java8-installer
Deu erro:
E: Sub-process /usr/bin/dpkg returned an error code (1)
Eu também tentei sudo apt-get -f install
e deu esta saída:
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)
Eu não usei meu servidor 16.10 por um ano e ele não foi atualizado em dois anos.
Eu usei sudo apt-get update
e obtive esta saída:
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.
Em seguida, executei sudo apt-get install oracle-java-8-installer
e deu esta saída:
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
Em seguida, executei sudo apt-add-repository --remove ppa:webupd8team/java
e obtive esta saída.
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'
Em seguida, executei sudo apt-get update
e deu esta saída:
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.
Em seguida, executei sudo apt-get install openjdk-8-jdk
e deu esta saída:
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
também para a versão atual do java:
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)