I am using a preseed file to auto install ubuntu 12.04. I create a normal user account (able to use sudo), I skip the creation of a root account. At the end of the file I have put this (seen it from here):
d-i preseed/late_command string in-target perl -pi -e 's/(errors=remount-ro)/noatime,nodiratime,$1,barrier=0/' /etc/fstab; in-target wget -P /tmp/ http://mytestserver.com/file/install_software_script.sh; in-target chmod $+x /tmp/install_software_script.sh; in-target /tmp/install_software_script.sh
inside the script i have those commands
#!/bin/bash
echo "Trying to install Java"
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer -y
sudo apt-get install oracle-java8-set-default -y
echo "Trying to install Redis"
sudo apt-get install redis-server -y
echo "Trying to install Git"
sudo apt-get install git -y
echo "Trying to install maven"
sudo apt-get install maven -y
exit 0
The installation is running smooth till the end of preseed file when I get error on the last command:
d-i preseed/late_command string in-target perl...
The ip I provide is reachable (I use the same for the preseed file). Does the bash script fail to install the packages without providing the user's credentials or is something wrong with the late_command ?
And one more question. After the reboot how could I use another bash script ? After linux installation & my script(above) are installed, the pc will reboot. I want after the reboot to run another script which will do some operations i.e start the redis server. How could I pass another automated script ?
Thanks.