无法安装 Java 8

无法安装 Java 8

我关注了教程安装 JAVA 8。
但是我收到以下错误消息:

sudo apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 oracle-java8-installer : Depends: java-common (>= 0.24) but it is not installable
                          Recommends: gsfonts-x11 but it is not installable
                          Recommends: oracle-java8-set-default but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我究竟做错了什么?

更新

我尝试安装java-common并得到:

developer@monad:~$ sudo apt-get update
Hit:1 http://archive.canonical.com bionic InRelease
Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                                         
Hit:4 http://ppa.launchpad.net/webupd8team/java/ubuntu bionic InRelease                                                                                              
Hit:6 http://dl.google.com/linux/chrome/deb stable Release                                     
Hit:7 http://ch.archive.ubuntu.com/ubuntu bionic-backports InRelease                           
Get:3 http://ch.archive.ubuntu.com/ubuntu bionic InRelease [242 kB]      
Get:8 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]         
Get:5 http://ch.archive.ubuntu.com/ubuntu bionic-updates InRelease [83.2 kB]                   
Get:10 http://ch.archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1'019 kB]                
Get:11 http://ch.archive.ubuntu.com/ubuntu bionic/main i386 Packages [1'007 kB]        
Get:12 http://ch.archive.ubuntu.com/ubuntu bionic/main Translation-en [516 kB]
Get:13 http://ch.archive.ubuntu.com/ubuntu bionic/main amd64 DEP-11 Metadata [477 kB]
Get:14 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 48x48 Icons [118 kB]
Get:14 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 48x48 Icons [118 kB]
Get:14 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 48x48 Icons [118 kB]
Get:14 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 48x48 Icons [118 kB]
Get:14 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 48x48 Icons [118 kB]
Get:14 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 48x48 Icons [118 kB]
Get:21 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [204 B]
Get:14 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 48x48 Icons [118 kB]
Get:14 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 48x48 Icons [118 kB]
Get:23 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [2'456 B]
Err:14 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 48x48 Icons                              
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:118319 [weak]
   - SHA256:72a445c7d354db04d1ffca6f52f7ab66953a3fa889bb66bf6d3210d3ab100f14
   - SHA1:176f580a423a2fcf3e257f0d9a00713e05545a35 [weak]
   - MD5Sum:bdfd4c6a690b2f9d0790443956b327fd [weak]
  Hashes of received file:
   - SHA256:39e0f680c56897c556fd4ce0dbba71e2622b0d1989f2e3fd5ab391d2c7c5c57f
   - SHA1:94e927ca7e5c296674fbed2580f9b34b3eb9f21c [weak]
   - MD5Sum:9b7c8db074b22f5aaba8c8161c204b67 [weak]
   - Filesize:162304 [weak]
  Last modification reported: Thu, 26 Apr 2018 21:24:34 +0000
  Release file created at: Thu, 26 Apr 2018 23:37:48 +0000
Get:24 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 64x64 Icons [245 kB]
Get:24 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 64x64 Icons [245 kB]
Get:24 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 64x64 Icons [245 kB]
Get:24 http://ch.archive.ubuntu.com/ubuntu bionic/main DEP-11 64x64 Icons [245 kB]
Get:30 http://ch.archive.ubuntu.com/ubuntu bionic/universe DEP-11 64x64 Icons [8'420 kB]
Get:30 http://ch.archive.ubuntu.com/ubuntu bionic/universe DEP-11 64x64 Icons [8'420 kB]
Get:30 http://ch.archive.ubuntu.com/ubuntu bionic/universe DEP-11 64x64 Icons [8'420 kB]
Get:30 http://ch.archive.ubuntu.com/ubuntu bionic/universe DEP-11 64x64 Icons [8'420 kB]
Get:35 http://ch.archive.ubuntu.com/ubuntu bionic/multiverse i386 Packages [144 kB]
Get:36 http://ch.archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [151 kB]
Get:36 http://ch.archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [151 kB]
Get:36 http://ch.archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [151 kB]
Get:36 http://ch.archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [151 kB]
Get:40 http://ch.archive.ubuntu.com/ubuntu bionic/multiverse Translation-en [108 kB]
Get:41 http://ch.archive.ubuntu.com/ubuntu bionic/multiverse amd64 DEP-11 Metadata [49.7 kB]
Get:42 http://ch.archive.ubuntu.com/ubuntu bionic/multiverse DEP-11 48x48 Icons [8'931 B]
Err:42 http://ch.archive.ubuntu.com/ubuntu bionic/multiverse DEP-11 48x48 Icons

Get:43 http://ch.archive.ubuntu.com/ubuntu bionic/multiverse DEP-11 64x64 Icons [225 kB]
Err:43 http://ch.archive.ubuntu.com/ubuntu bionic/multiverse DEP-11 64x64 Icons

Get:44 http://ch.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 48x48 Icons [1'968 B]
Err:44 http://ch.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 48x48 Icons
  File has unexpected size (3584 != 1968). Mirror sync in progress? [IP: 130.59.113.36 80]
  Hashes of expected file:
   - Filesize:1968 [weak]
   - SHA256:cf4c0efefe32dbb80cc114bbcfea0a0839b376b3a226e5d0eec524dfa9a036ba
   - SHA1:6b216ddc4346a7b7ac7952c21dab5b5dc85be71a [weak]
   - MD5Sum:31363305fb0d685cd116efd64c89d0f5 [weak]
  Release file created at: Wed, 16 May 2018 05:38:20 +0000
Fetched 1'039 kB in 2s (473 kB/s)                        
Reading package lists... Done
E: Failed to fetch http://ch.archive.ubuntu.com/ubuntu/dists/bionic/main/dep11/by-hash/SHA256/72a445c7d354db04d1ffca6f52f7ab66953a3fa889bb66bf6d3210d3ab100f14  Hash Sum mismatch
   Hashes of expected file:
    - Filesize:118319 [weak]
    - SHA256:72a445c7d354db04d1ffca6f52f7ab66953a3fa889bb66bf6d3210d3ab100f14
    - SHA1:176f580a423a2fcf3e257f0d9a00713e05545a35 [weak]
    - MD5Sum:bdfd4c6a690b2f9d0790443956b327fd [weak]
   Hashes of received file:
    - SHA256:39e0f680c56897c556fd4ce0dbba71e2622b0d1989f2e3fd5ab391d2c7c5c57f
    - SHA1:94e927ca7e5c296674fbed2580f9b34b3eb9f21c [weak]
    - MD5Sum:9b7c8db074b22f5aaba8c8161c204b67 [weak]
    - Filesize:162304 [weak]
   Last modification reported: Thu, 26 Apr 2018 21:24:34 +0000
   Release file created at: Thu, 26 Apr 2018 23:37:48 +0000
E: Failed to fetch http://ch.archive.ubuntu.com/ubuntu/dists/bionic/main/dep11/by-hash/SHA256/57f27cd53b92604cbf5c549382eec53d66ef2500fbdd54692688fd3675786aeb  
E: Failed to fetch http://ch.archive.ubuntu.com/ubuntu/dists/bionic/universe/dep11/by-hash/SHA256/44352c8652af9c9071b7cc7a035de3cd55b012e1df7291644bf9b99fd9dffd5a  
E: Failed to fetch http://ch.archive.ubuntu.com/ubuntu/dists/bionic/universe/dep11/by-hash/SHA256/ad41f363b444b3cec5ab94623ea0a5b42a7ea0165e70af3aabf14f244bdbd9eb  
E: Failed to fetch http://ch.archive.ubuntu.com/ubuntu/dists/bionic/multiverse/dep11/by-hash/SHA256/19202b981090cae365536eff597fad79c481e6104bbdb4b5c74c26871123d307  
W: Failed to fetch http://ch.archive.ubuntu.com/ubuntu/dists/bionic/multiverse/dep11/by-hash/SHA256/cbdc792d40b3644aa3fc1fc86f08b8449acf078a5ae52435dcf8dec8e941b897  
E: Failed to fetch http://ch.archive.ubuntu.com/ubuntu/dists/bionic-updates/main/dep11/by-hash/SHA256/cf4c0efefe32dbb80cc114bbcfea0a0839b376b3a226e5d0eec524dfa9a036ba  File has unexpected size (3584 != 1968). Mirror sync in progress? [IP: 130.59.113.36 80]
   Hashes of expected file:
    - Filesize:1968 [weak]
    - SHA256:cf4c0efefe32dbb80cc114bbcfea0a0839b376b3a226e5d0eec524dfa9a036ba
    - SHA1:6b216ddc4346a7b7ac7952c21dab5b5dc85be71a [weak]
    - MD5Sum:31363305fb0d685cd116efd64c89d0f5 [weak]
   Release file created at: Wed, 16 May 2018 05:38:20 +0000
E: Failed to fetch http://ch.archive.ubuntu.com/ubuntu/dists/bionic-updates/main/dep11/by-hash/SHA256/2b149a45789655d141ab257c7d7cb5d23ade57a6cc37b50bdb3b809889038b8c  
E: Failed to fetch http://ch.archive.ubuntu.com/ubuntu/dists/bionic-updates/universe/dep11/by-hash/SHA256/3f6762646dd674ed60d5ed3c1079f9ece9d61077d3becb1366a643f745cf4fb6  
E: Failed to fetch http://ch.archive.ubuntu.com/ubuntu/dists/bionic-updates/universe/dep11/by-hash/SHA256/0a561754077734a04bc7ab7c6c2a105ad8973f70191aa8fc428695bd67651b82  
W: Some index files failed to download. They have been ignored, or old ones used instead.
developer@monad:~$ sudo apt-get install java-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package java-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'java-common' has no installation candidate

答案1

以下软件包具有未满足的依赖关系:

oracle-java8-安装程序:依赖:java-common(>= 0.24)但无法安装

建议:gsfonts-x11但无法安装

建议:oracle-java8-设置默认值但它不会被安装 E:无法纠正问题,您持有损坏的包裹。

上面的粗体文字说明了一切。java-common安装

sudo apt-get install java-common

相关内容