Add --force-yes to apt commands (#59557)

We use -y to automate apt install commands within vagrant provisioning.
However, this is sometimes insufficient, for example when a gpg
signature signing the package expires. This commit adds the extra
--force-yes flag, to tell apt-get we really mean business.

closes #59495
This commit is contained in:
Ryan Ernst 2020-07-20 13:09:26 -07:00 committed by GitHub
parent 823c337e76
commit 5267ba819f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

10
Vagrantfile vendored
View file

@ -186,7 +186,7 @@ def deb_common(config, name, extra: '')
name, name,
update_command: 'apt-get update', update_command: 'apt-get update',
update_tracking_file: '/var/cache/apt/archives/last_update', update_tracking_file: '/var/cache/apt/archives/last_update',
install_command: 'apt-get install -y', install_command: 'apt-get install -y --force-yes',
extra: extra_with_lintian extra: extra_with_lintian
) )
end end
@ -194,7 +194,7 @@ end
def ubuntu_docker(config) def ubuntu_docker(config)
config.vm.provision 'install Docker using apt', type: 'shell', inline: <<-SHELL config.vm.provision 'install Docker using apt', type: 'shell', inline: <<-SHELL
# Install packages to allow apt to use a repository over HTTPS # Install packages to allow apt to use a repository over HTTPS
apt-get install -y \ apt-get install -y --force-yes \
apt-transport-https \ apt-transport-https \
ca-certificates \ ca-certificates \
curl \ curl \
@ -212,7 +212,7 @@ def ubuntu_docker(config)
# Install Docker. Unlike Fedora and CentOS, this also start the daemon. # Install Docker. Unlike Fedora and CentOS, this also start the daemon.
apt-get update apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io apt-get install -y --force-yes docker-ce docker-ce-cli containerd.io
# Add vagrant to the Docker group, so that it can run commands # Add vagrant to the Docker group, so that it can run commands
usermod -aG docker vagrant usermod -aG docker vagrant
@ -227,7 +227,7 @@ end
def deb_docker(config) def deb_docker(config)
config.vm.provision 'install Docker using apt', type: 'shell', inline: <<-SHELL config.vm.provision 'install Docker using apt', type: 'shell', inline: <<-SHELL
# Install packages to allow apt to use a repository over HTTPS # Install packages to allow apt to use a repository over HTTPS
apt-get install -y \ apt-get install -y --force-yes \
apt-transport-https \ apt-transport-https \
ca-certificates \ ca-certificates \
curl \ curl \
@ -245,7 +245,7 @@ def deb_docker(config)
# Install Docker. Unlike Fedora and CentOS, this also start the daemon. # Install Docker. Unlike Fedora and CentOS, this also start the daemon.
apt-get update apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io apt-get install -y --force-yes docker-ce docker-ce-cli containerd.io
# Add vagrant to the Docker group, so that it can run commands # Add vagrant to the Docker group, so that it can run commands
usermod -aG docker vagrant usermod -aG docker vagrant