在Ubuntu 12.04上以非交互方式安装Java 1.7

前端之家收集整理的这篇文章主要介绍了在Ubuntu 12.04上以非交互方式安装Java 1.7前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我需要在几台机器上安装 Java 1.7,因此我想使用脚本来完成它.问题是安装要求某些选项(特定’Y’,然后’OK’,最后’是’).我遇到了这个问题:

Automate the installation of postfix on Ubuntu

我很确定这个过程是在同一条线上.但我不知道OP如何知道变量名称(?),如postfix postfix / mailname等.

如果有人可以提供更直接的答案,那将非常感激.

编辑1:

我尝试将sudo dpkg-reconfigure debconf设置为非交互式,并选择警报级别为批评.然后我尝试执行sudo apt-get install oracle-java7-installer并得到此错误

Need to get 0 B/18.6 kB of archives.
After this operation,193 kB of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 47992 files and directories currently installed.)
Unpacking oracle-java7-installer (from .../oracle-java7-installer_7u51-0~webupd8~4_all.deb) ...

oracle-license-v1-1 license could not be presented
try 'dpkg-reconfigure debconf' to select a frontend other than noninteractive

dpkg: error processing /var/cache/apt/archives/oracle-java7-installer_7u51-0~webupd8~4_all.deb (--unpack):
 subprocess new pre-installation script returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/oracle-java7-installer_7u51-0~webupd8~4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
大概是 the same as with Java 8
echo debconf shared/accepted-oracle-license-v1-1 select true | \
  sudo debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | \
  sudo debconf-set-selections

apt-get -y install oracle-java7-installer oracle-java7-set-default
原文链接:https://www.f2er.com/ubuntu/347866.html

猜你在找的Ubuntu相关文章