ubuntu 16.04 安装jdk9错误

转自:https://askubuntu.com/questions/769467/can-not-install-openjdk-9-jdk-because-it-tries-to-overwrite-file-aready-includ

  1. Normally try to install the openjdk-9-jdk package, preferably using the package manager apt:

    sudo apt install openjdk-9-jdk
    

    This will install all of its dependencies and also download the binary package file. It should be stored at /var/cache/apt/archives/openjdk-9-jdk_9~b114-0ubuntu1_amd64.deb now, but the file name's second half may differ in case you're having a different version.

    Please note that we expect this single command to fail with the error message described in the question. Ignore the error, we'll take care of that in the next steps.

  2. The dependency packages were not fully configured yet because the installation of openjdk-9-jdk failed and got aborted. We have to do that manually now and simply trigger the configuration of all not yet configured packages:

    sudo dpkg --configure -a
    
  3. Finally we install our openjdk-9-jdk package. Therefore we use the downloaded and cached binary package file we got in step 1. We have to add the --force-overwrite flag to make the package manager ignore our doubly provided file and quietly overwrite it.

    sudo dpkg -i --force-overwrite '/var/cache/apt/archives/openjdk-9-jdk_9~b114-0ubuntu1_amd64.deb'
    

    You may have to adapt the file name in case you're having a different version, or just use tab-completion to enter the file name: press Tab after having entered the file name up to the underscore (...openjdk-9-jdk_) and it should autocomplete the correct file name.

转载于:https://www.cnblogs.com/dirt2/p/6803549.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值