From 495c7ea0628697a6ce0bf7aaa5cc749861c662a4 Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Sun, 3 Jun 2018 17:23:05 +0800 Subject: [PATCH 1/2] Replace invocations to apt with apt-get (Closes: subutai-io/vagrant#103) --- provisioning/en/provisioner.sh | 2 +- scripts/ubuntu/zfs.sh | 4 ++-- scripts/zfs.sh | 4 ++-- stretch/hyperv/provisioner.jsonnet | 6 +++--- xenial/hyperv/provisioner.jsonnet | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/provisioning/en/provisioner.sh b/provisioning/en/provisioner.sh index 0814458..d8582cd 100644 --- a/provisioning/en/provisioner.sh +++ b/provisioning/en/provisioner.sh @@ -70,7 +70,7 @@ else echo "Installing $CMD ..." echo >> /etc/apt/sources.list echo "deb http://deb.subutai.io/subutai $ENV main" | tee --append /etc/apt/sources.list - apt update && apt -y install subutai + apt-get update && apt-get -y install subutai cmd_path="$(which $CMD)" fi diff --git a/scripts/ubuntu/zfs.sh b/scripts/ubuntu/zfs.sh index 088ed95..cb482e1 100644 --- a/scripts/ubuntu/zfs.sh +++ b/scripts/ubuntu/zfs.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -apt -y install zfsutils-linux +apt-get -y install zfsutils-linux /sbin/modprobe zfs @@ -10,7 +10,7 @@ zfs create -o mountpoint="/var/lib/lxc" subutai/fs zpool set autoexpand=on subutai -apt -y install lxc +apt-get -y install lxc apt-get -y install dirmngr diff --git a/scripts/zfs.sh b/scripts/zfs.sh index 5c567e5..eaea5a1 100644 --- a/scripts/zfs.sh +++ b/scripts/zfs.sh @@ -1,6 +1,6 @@ #!/bin/bash -apt -y install zfsutils +apt-get -y install zfsutils /sbin/modprobe zfs @@ -10,7 +10,7 @@ zfs create -o mountpoint="/var/lib/lxc" subutai/fs zpool set autoexpand=on subutai -apt -y install lxc +apt-get -y install lxc apt-get -y install dirmngr diff --git a/stretch/hyperv/provisioner.jsonnet b/stretch/hyperv/provisioner.jsonnet index 65b7e5c..7f4e421 100644 --- a/stretch/hyperv/provisioner.jsonnet +++ b/stretch/hyperv/provisioner.jsonnet @@ -19,13 +19,13 @@ "cp /tmp/sources.list /etc/apt/sources.list", "apt-get update", "sed -i '1 i\\ulimit -n 65535' /etc/profile", - "apt -y install zfsutils", + "apt-get -y install zfsutils", "/sbin/modprobe zfs", "zpool create -f subutai /dev/mapper/main-zfs", "zfs create -o mountpoint=\"/var/lib/lxc\" subutai/fs", "zpool set autoexpand=on subutai", - "apt -y install lxc", + "apt-get -y install lxc", "apt-get -y install dirmngr", "apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C6B2AC7FBEB649F1" ] - } \ No newline at end of file + } diff --git a/xenial/hyperv/provisioner.jsonnet b/xenial/hyperv/provisioner.jsonnet index 24d0ef0..823fec0 100644 --- a/xenial/hyperv/provisioner.jsonnet +++ b/xenial/hyperv/provisioner.jsonnet @@ -21,13 +21,13 @@ "cp /tmp/sources.list /etc/apt/sources.list", "apt-get update", "sed -i '1 i\\ulimit -n 65535' /etc/profile", - "apt -y install zfsutils-linux", + "apt-get -y install zfsutils-linux", "/sbin/modprobe zfs", "zpool create -f subutai /dev/mapper/main-zfs", "zfs create -o mountpoint=\"/var/lib/lxc\" subutai/fs", "zpool set autoexpand=on subutai", - "apt -y install lxc", + "apt-get -y install lxc", "apt-get -y install dirmngr", "apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C6B2AC7FBEB649F1" ] - } \ No newline at end of file + } From 3d9179a4995b202d5551c4041ce9467bff105f1c Mon Sep 17 00:00:00 2001 From: Aron Xu Date: Sun, 3 Jun 2018 17:53:36 +0800 Subject: [PATCH 2/2] Add DEBIAN_FRONTEND=noninteractive to apt-get --- http/stretch.bat | 4 ++-- provisioning/en/provisioner.sh | 2 +- scripts/apt.sh | 6 +++--- scripts/cleanup.sh | 8 ++++---- scripts/debian/vmware.sh | 2 +- scripts/ubuntu/vmware.sh | 2 +- scripts/ubuntu/zfs.sh | 6 +++--- scripts/vbox.sh | 6 +++--- scripts/zfs.sh | 6 +++--- stretch/hyperv/provisioner.jsonnet | 14 +++++++------- xenial/hyperv/provisioner.jsonnet | 18 +++++++++--------- 11 files changed, 37 insertions(+), 37 deletions(-) diff --git a/http/stretch.bat b/http/stretch.bat index 572887e..f503ba2 100644 --- a/http/stretch.bat +++ b/http/stretch.bat @@ -80,5 +80,5 @@ echo d-i finish-install/reboot_in_progress note type .\http\packages.cfg>>.\http\stretch.cfg ( -echo d-i preseed/late_command string sed -i -e "s/.*PermitRootLogin.*/PermitRootLogin yes/g" /target/etc/ssh/sshd_config ; chroot /target /bin/bash -c 'service ssh stop ; apt-get install hyperv-daemons' ; -)>>.\http\stretch.cfg \ No newline at end of file +echo d-i preseed/late_command string sed -i -e "s/.*PermitRootLogin.*/PermitRootLogin yes/g" /target/etc/ssh/sshd_config ; chroot /target /bin/bash -c 'service ssh stop ; DEBIAN_FRONTEND=noninteractive apt-get install hyperv-daemons' ; +)>>.\http\stretch.cfg diff --git a/provisioning/en/provisioner.sh b/provisioning/en/provisioner.sh index d8582cd..57b65a0 100644 --- a/provisioning/en/provisioner.sh +++ b/provisioning/en/provisioner.sh @@ -70,7 +70,7 @@ else echo "Installing $CMD ..." echo >> /etc/apt/sources.list echo "deb http://deb.subutai.io/subutai $ENV main" | tee --append /etc/apt/sources.list - apt-get update && apt-get -y install subutai + DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install subutai cmd_path="$(which $CMD)" fi diff --git a/scripts/apt.sh b/scripts/apt.sh index c3d4963..e397436 100755 --- a/scripts/apt.sh +++ b/scripts/apt.sh @@ -1,13 +1,13 @@ #!/bin/bash echo Updating from repositories ... -sudo apt-get -y update +sudo DEBIAN_FRONTEND=noninteractive apt-get -y update echo Upgrading distribution ... -sudo apt-get -y dist-upgrade +sudo DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade echo Adding needed packages ... -sudo apt-get -y install net-tools inotify-tools +sudo DEBIAN_FRONTEND=noninteractive apt-get -y install net-tools inotify-tools diff --git a/scripts/cleanup.sh b/scripts/cleanup.sh index 892b2fe..f3bc51d 100755 --- a/scripts/cleanup.sh +++ b/scripts/cleanup.sh @@ -5,10 +5,10 @@ if [ -z "$BRANCHTAG" ]; then exit -1 fi -apt-get -y autoremove +DEBIAN_FRONTEND=noninteractive apt-get -y autoremove # seems this is removing everything we install -#sudo dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge +#sudo dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo DEBIAN_FRONTEND=noninteractive apt-get -y purge echo "cleaning up dhcp leases" rm /var/lib/dhcp/* @@ -20,7 +20,7 @@ fi echo "Replacing /etc/apt/sources.list with standard sources" cp /tmp/sources.list /etc/apt/sources.list -apt-get update +DEBIAN_FRONTEND=noninteractive apt-get update echo "Setting ulimit -n 65535 in /etc/profile" -sed -i '1 i\ulimit -n 65535' /etc/profile \ No newline at end of file +sed -i '1 i\ulimit -n 65535' /etc/profile diff --git a/scripts/debian/vmware.sh b/scripts/debian/vmware.sh index cce598a..9faa4ee 100644 --- a/scripts/debian/vmware.sh +++ b/scripts/debian/vmware.sh @@ -1,7 +1,7 @@ #!/bin/sh -eux # install open-vm-tools -apt-get install -y open-vm-tools; +DEBIAN_FRONTEND=noninteractive apt-get install -y open-vm-tools; # set a default HOME_DIR environment variable if not set HOME_DIR="${HOME_DIR:-/home/subutai}"; diff --git a/scripts/ubuntu/vmware.sh b/scripts/ubuntu/vmware.sh index 823f316..0e643ed 100644 --- a/scripts/ubuntu/vmware.sh +++ b/scripts/ubuntu/vmware.sh @@ -1,5 +1,5 @@ #!/bin/sh -eux -apt-get install -y open-vm-tools; +DEBIAN_FRONTEND=noninteractive apt-get install -y open-vm-tools; mkdir /mnt/hgfs; echo "platform specific vmware.sh executed"; diff --git a/scripts/ubuntu/zfs.sh b/scripts/ubuntu/zfs.sh index cb482e1..b9372f2 100644 --- a/scripts/ubuntu/zfs.sh +++ b/scripts/ubuntu/zfs.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -apt-get -y install zfsutils-linux +DEBIAN_FRONTEND=noninteractive apt-get -y install zfsutils-linux /sbin/modprobe zfs @@ -10,9 +10,9 @@ zfs create -o mountpoint="/var/lib/lxc" subutai/fs zpool set autoexpand=on subutai -apt-get -y install lxc +DEBIAN_FRONTEND=noninteractive apt-get -y install lxc -apt-get -y install dirmngr +DEBIAN_FRONTEND=noninteractive apt-get -y install dirmngr apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C6B2AC7FBEB649F1 diff --git a/scripts/vbox.sh b/scripts/vbox.sh index 88607c6..7ea3aa0 100755 --- a/scripts/vbox.sh +++ b/scripts/vbox.sh @@ -2,8 +2,8 @@ echo "==> Installing VirtualBox guest additions" # Assuming the following packages are installed -apt-get install -y linux-headers-$(uname -r) build-essential perl -apt-get install -y dkms +DEBIAN_FRONTEND=noninteractive apt-get install -y linux-headers-$(uname -r) build-essential perl +DEBIAN_FRONTEND=noninteractive apt-get install -y dkms VBOX_VERSION=$(cat /home/${SSH_USERNAME}/.vbox_version) mount -o loop /home/${SSH_USERNAME}/VBoxGuestAdditions_$VBOX_VERSION.iso /mnt @@ -14,4 +14,4 @@ rm /home/${SSH_USERNAME}/.vbox_version if [[ $VBOX_VERSION = "4.3.10" ]]; then ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions -fi \ No newline at end of file +fi diff --git a/scripts/zfs.sh b/scripts/zfs.sh index eaea5a1..be00839 100644 --- a/scripts/zfs.sh +++ b/scripts/zfs.sh @@ -1,6 +1,6 @@ #!/bin/bash -apt-get -y install zfsutils +DEBIAN_FRONTEND=noninteractive apt-get -y install zfsutils /sbin/modprobe zfs @@ -10,9 +10,9 @@ zfs create -o mountpoint="/var/lib/lxc" subutai/fs zpool set autoexpand=on subutai -apt-get -y install lxc +DEBIAN_FRONTEND=noninteractive apt-get -y install lxc -apt-get -y install dirmngr +DEBIAN_FRONTEND=noninteractive apt-get -y install dirmngr apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C6B2AC7FBEB649F1 diff --git a/stretch/hyperv/provisioner.jsonnet b/stretch/hyperv/provisioner.jsonnet index 7f4e421..4382d6c 100644 --- a/stretch/hyperv/provisioner.jsonnet +++ b/stretch/hyperv/provisioner.jsonnet @@ -5,11 +5,11 @@ "echo 'subutai ALL=NOPASSWD: ALL' >> /etc/sudoers", "date > /home/{{user `ssh_username`}}/vagrant_box_build_time", "echo Updating from repositories ...", - "apt-get -y update", + "DEBIAN_FRONTEND=noninteractive apt-get -y update", "echo Upgrading distribution ...", - "apt-get -y dist-upgrade", + "DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade", "echo Adding needed packages ...", - "apt-get -y install net-tools inotify-tools", + "DEBIAN_FRONTEND=noninteractive apt-get -y install net-tools inotify-tools", "echo \"{{user `ssh_username`}} ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers.d/{{user `ssh_username`}}", "chmod 440 /etc/sudoers.d/{{user `ssh_username`}}", "mkdir -pm 700 /home/{{user `ssh_username`}}/.ssh", @@ -17,15 +17,15 @@ "chmod 0600 /home/{{user `ssh_username`}}/.ssh/authorized_keys", "chown -R {{user `ssh_username`}}:{{user `ssh_username`}} /home/{{user `ssh_username`}}/.ssh", "cp /tmp/sources.list /etc/apt/sources.list", - "apt-get update", + "DEBIAN_FRONTEND=noninteractive apt-get update", "sed -i '1 i\\ulimit -n 65535' /etc/profile", - "apt-get -y install zfsutils", + "DEBIAN_FRONTEND=noninteractive apt-get -y install zfsutils", "/sbin/modprobe zfs", "zpool create -f subutai /dev/mapper/main-zfs", "zfs create -o mountpoint=\"/var/lib/lxc\" subutai/fs", "zpool set autoexpand=on subutai", - "apt-get -y install lxc", - "apt-get -y install dirmngr", + "DEBIAN_FRONTEND=noninteractive apt-get -y install lxc", + "DEBIAN_FRONTEND=noninteractive apt-get -y install dirmngr", "apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C6B2AC7FBEB649F1" ] } diff --git a/xenial/hyperv/provisioner.jsonnet b/xenial/hyperv/provisioner.jsonnet index 823fec0..67eb9ba 100644 --- a/xenial/hyperv/provisioner.jsonnet +++ b/xenial/hyperv/provisioner.jsonnet @@ -5,13 +5,13 @@ "echo 'subutai ALL=NOPASSWD: ALL' >> /etc/sudoers", "date > /home/{{user `ssh_username`}}/vagrant_box_build_time", "echo Updating from repositories ...", - "apt-get -y update", + "DEBIAN_FRONTEND=noninteractive apt-get -y update", "echo Upgrading distribution ...", - "apt-get -y dist-upgrade", + "DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade", "echo Adding needed packages ...", - "apt-get -y install net-tools inotify-tools", - "apt-get -y install linux-cloud-tools-$(uname -r)", - "apt-get -y install linux-virtual-lts-xenial linux-tools-virtual-lts-xenial linux-cloud-tools-virtual-lts-xenial", + "DEBIAN_FRONTEND=noninteractive apt-get -y install net-tools inotify-tools", + "DEBIAN_FRONTEND=noninteractive apt-get -y install linux-cloud-tools-$(uname -r)", + "DEBIAN_FRONTEND=noninteractive apt-get -y install linux-virtual-lts-xenial linux-tools-virtual-lts-xenial linux-cloud-tools-virtual-lts-xenial", "echo \"{{user `ssh_username`}} ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers.d/{{user `ssh_username`}}", "chmod 440 /etc/sudoers.d/{{user `ssh_username`}}", "mkdir -pm 700 /home/{{user `ssh_username`}}/.ssh", @@ -19,15 +19,15 @@ "chmod 0600 /home/{{user `ssh_username`}}/.ssh/authorized_keys", "chown -R {{user `ssh_username`}}:{{user `ssh_username`}} /home/{{user `ssh_username`}}/.ssh", "cp /tmp/sources.list /etc/apt/sources.list", - "apt-get update", + "DEBIAN_FRONTEND=noninteractive apt-get update", "sed -i '1 i\\ulimit -n 65535' /etc/profile", - "apt-get -y install zfsutils-linux", + "DEBIAN_FRONTEND=noninteractive apt-get -y install zfsutils-linux", "/sbin/modprobe zfs", "zpool create -f subutai /dev/mapper/main-zfs", "zfs create -o mountpoint=\"/var/lib/lxc\" subutai/fs", "zpool set autoexpand=on subutai", - "apt-get -y install lxc", - "apt-get -y install dirmngr", + "DEBIAN_FRONTEND=noninteractive apt-get -y install lxc", + "DEBIAN_FRONTEND=noninteractive apt-get -y install dirmngr", "apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C6B2AC7FBEB649F1" ] }