简体   繁体   English

“ apt-get install openjdk-8-jdk”与下载* .tar.gz之间存在差异

[英]Diffrences between “apt-get install openjdk-8-jdk” and downloading *.tar.gz

I want to install openjdk on ubuntu. 我想在ubuntu上安装openjdk。 I found two ways to install it. 我发现了两种安装方法。

The first is typing "sudo apt-get install openjdk-8-jdk" on terminal. 第一种是在终端上键入“ sudo apt-get install openjdk-8-jdk”。

The second is downloading the binary file such as *.tar.gz and then unpack the file and set environment variables JAVA_HOME&PATH. 第二个是下载二进制文件,例如* .tar.gz,然后解压缩该文件并设置环境变量JAVA_HOME&PATH。

So, is there any difference between this two methods? 那么,这两种方法之间有什么区别吗? I mean, will it cause different results? 我的意思是,这会导致不同的结果吗?

Thanks a lot. 非常感谢。

使用第一种方法,安装由Debians Apt软件包管理器控制,并将接收更新,而使用第二种方法,则必须手动进行安装。

It will probably not end with different result. 它可能不会以不同的结果结束。 On linux distributions you have what is called a packet manager : Yours (and on almost every ubuntu) is APT. 在linux发行版中,您拥有所谓的数据包管理器 :您的(几乎在每个ubuntu上)都是APT。 So the main difference is that when you use apt, you can "trust more" what you are downloading, because hopefully, content in apt are check. 因此,主要区别在于,当您使用apt时,您可以“信任更多”所下载的内容,因为希望apt中的内容受到检查。 However, because of this checking, apt isn't every time up-to-date, and it may induce some difference in version. 但是,由于进行了这种检查,因此apt并非每次都是最新的,并且可能会导致版本有所不同。 However, in my opinion if you doesn't want to duplicate file or pollute your system, you may want to choose either one option and stay with it : if you use apt, use apt to update, if you download it manually keep updating it manually. 但是,在我看来,如果您不想复制文件或污染系统,则可能要选择一个选项并保留它:如果使用apt,请使用apt更新,如果您手动下载,请继续更新手动。 I personally prefer to use apt when possible. 我个人更喜欢在可能的情况下使用apt。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM