Ubuntu20.04安装 JDK-8 缺少Breaks: x11-common (< 1:7.7+23~) but 1:7.7+19ubuntu7.1 is

1,023 阅读1分钟

Ubuntu20.04安装 JDK-8 缺少Breaks: x11-common (< 1:7.7+23~) but 1:7.7+19ubuntu7.1 is to be installed解决方法

  • 缺少x11-common,直接安装x11-common 也是失败

06011dd9bbbebe2ad83bfffe5525e9a.png

  • 备份原有源,更换官方源

    deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
    
    deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
    
    deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
    
    deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
    deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
    
    ## Not recommended
    # deb http://archive.ubuntu.com/ubuntu/ jammy-proposed main restricted universe multiverse
    # deb-src http://archive.ubuntu.com/ubuntu/ jammy-proposed main restricted universe multiverse
    
  • 更新源,安装 x11-common

    sudo apt update 
    sudo apt install x11-common
    
  • 安装 **JDK-8 **

    sudo apt install openjdk-8-jdk
    
  • 最后查看是否安装成功

    java -version
    
  • 安装成功

e95328597c3fd84095f0f79c861bc65.png