如何使用packer provisioner在ubuntu实例中安装java8?

时间:2016-06-02 00:35:36

标签: ubuntu-12.04 packer

尝试使用基于在线ami的打包器构建AMI(最好是精确的ubuntu 12.04)。寻找java 8安装的配置器定义。我已经连接了多个安装并执行它已经很好。但是,使用ppa的java8不会发生在定义中的以下命令。随着厨师的发生没有任何麻烦,但我想与包装商提供。

"sudo apt-get install python-software-properties",
"sudo apt-add-repository ppa:webupd8team/java",
"sudo apt-get install oracle-java8-installer".

我尝试的其他替代方案:

sudo apt-get update sudo apt-get software-properties-common sudo apt-get install software-properties-common sudo add-apt-repository ppa:webupd8team / java sudo apt-get install oracle-java8-installer

参考: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

https://askubuntu.com/questions/445536/unable-to-locate-package-add-apt-repository-error

如果您找到任何成功的实施,请帮助我完成配置器定义。

错误:

root@ubuntu:/home/xyzqwerty# sudo apt-get install oracle-java8-installer
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package oracle-java8-installer

1 个答案:

答案 0 :(得分:2)

"sudo apt-get install -y software-properties-common",
"sudo add-apt-repository -y ppa:webupd8team/java",
"sudo apt-get update",
"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",
"sudo apt-get install -y oracle-java8-installer",
"sudo apt-get install oracle-java8-set-default",

got it here