騰訊云服務器安裝Java環(huán)境問題:

系統(tǒng):Ubuntu Server 18.04.1 LTS 64位
安裝:Maven、Java環(huán)境時拋錯:
E: Unable to locate package upgrade

解決辦法:
對于Ubuntu操作系統(tǒng),很多同學在使用apt-get install的時候 會發(fā)現(xiàn)很多源都找不到,原因是系統(tǒng)初始的資源庫找不到指定的包,解決方法:

1、執(zhí)行下面的命令,編輯系統(tǒng)資源庫列表:

         vi /etc/apt/sources.list

2、修改為以下內(nèi)容(原來的內(nèi)容可以注釋一下):

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

3、執(zhí)行下面的命令,更新系統(tǒng)資源庫列表:

         sudo apt-get update

         sudo apt-get upgrade

4、重新執(zhí)行sudo apt-get install xxxx 試試

安裝openjdk

1、更新軟件包列表:
sudo apt-get update

2、安裝openjdk-8-jdk:
sudo apt-get install openjdk-8-jdk

3、查看java版本,看看是否安裝成功:
java -version

image
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容