ubuntu apt-get 安装jdk
<div class="cnblogs_code"><pre>参考地址:https://blog.csdn.net/ywueoei/article/details/80335799、 https://blog.csdn.net/inhumming/article/details/80379785</pre>
<div class="navbar-header"> 清华大学开源软件镜像站: https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ </div>
<div class="navbar-header"> </div>
</div>
<p><strong>根据自己的系统版本选择 ubuntu 查看系统: sudo lsb_release -a </strong></p>
<p>更多信息参考:https://blog.csdn.net/weixin_39876223/article/details/81782397</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)"> # 以下命令解释
Distributor ID: Ubuntu </span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">类别是ubuntu</span>
Description: Ubuntu <span style="color: rgba(128, 0, 128, 1)">14.04</span>.<span style="color: rgba(128, 0, 128, 1)">2</span> LTS <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">14年2月4月发布的稳定版本,LTS是Long Term Support:长时间支持版本 三年 ,一般是18个月</span>
Release: <span style="color: rgba(128, 0, 128, 1)">14.04</span> <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">发行日期或者是发行版本号</span>
Codename: trusty <span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">ubuntu的代号名称</span></pre>
</div>
<p><strong>配置镜像:ubuntu 支持armhf 国内镜像 </strong></p>
<p>修改镜像地址</p>
<div class="cnblogs_code">
<pre> sudo vi /etc/apt/source.list 注意:记得备份文件</pre>
</div>
<p>Ubuntu armhf版本的源网址不同于普通Ubuntu系统,如果采用如下网址会出现问题,导致sudo apt-get update出现Error。</p>
<p>由于默认采用的是国外的源,导致apt安装依赖包是奇慢无比,从网上找到了一个国内支持armhf的源,速度一下快了许多。</p>
<div class="cnblogs_code">
<pre>deb http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe</span>
deb http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe</span>
deb http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe</span>
deb http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe</span>
deb http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe</span>
deb-src http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe</span>
deb-src http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe</span>
deb-src http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe</span>
deb-src http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe</span>
deb-src http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe<br>deb http://cn.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse<br></span></pre>
</div>
<p>安装jdk</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">更新源
sudo apt</span>-<span style="color: rgba(0, 0, 255, 1)">get</span><span style="color: rgba(0, 0, 0, 1)"> update
安装默认JRE</span>/<span style="color: rgba(0, 0, 0, 1)">JDK
sudo apt</span>-<span style="color: rgba(0, 0, 255, 1)">get</span> install <span style="color: rgba(0, 0, 255, 1)">default</span>-<span style="color: rgba(0, 0, 0, 1)">jre
sudo apt</span>-<span style="color: rgba(0, 0, 255, 1)">get</span> install <span style="color: rgba(0, 0, 255, 1)">default</span>-<span style="color: rgba(0, 0, 0, 1)">jdk
安装oracle JDK
sudo apt</span>-<span style="color: rgba(0, 0, 255, 1)">get</span> install software-properties-<span style="color: rgba(0, 0, 0, 1)">common
sudo add</span>-apt-repository ppa:webupd8team/<span style="color: rgba(0, 0, 0, 1)">java
sudo apt</span>-<span style="color: rgba(0, 0, 255, 1)">get</span><span style="color: rgba(0, 0, 0, 1)"> update
安装JDK8
sudo apt</span>-<span style="color: rgba(0, 0, 255, 1)">get</span> install oracle-java8-<span style="color: rgba(0, 0, 0, 1)">installer
java </span>-version</pre>
</div>
<p> </p>
</div>
<div id="MySignature" role="contentinfo">
文章属于个人工作备忘录,欢迎指正...<br><br>
来源:https://www.cnblogs.com/louby/p/10837864.html
頁:
[1]