0

Here is my bootstrap.sh

apt-get update
apt-get install -y python-software-properties
add-apt-repository -y ppa:webupd8team/java
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections

# Update apt sources
apt-get update

# Install stuff available through apt-get
apt-get install -y unzip wget oracle-java7-installer oracle-java7-set-default

I am trying to understand why is these two lines

add-apt-repository -y ppa:webupd8team/java
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections

necessary for installing Java.

According to ubuntu manual,

add-apt-repository 

is a script which adds an external APT repository to
   either  /etc/apt/sources.list  or a file in /etc/apt/sources.list.d/ or
   removes an already existing repository.

but should't the apt repository be automatically updated, when you

 apt-get update
 apt-get install -y oracle-java7-installer

?

And what does

echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections

do?

muru
  • 197,895
  • 55
  • 485
  • 740
testing
  • 101

1 Answers1

0

It seems this bootstrap.sh is part of this vagrant which requires that you have Oracle Java7 is installed. So it is making a check and if not echoing it and then taking a particular action(install Oracle Java7). It's using the standard ppa for Oracle Java7 install.

Ashu
  • 3,966