Skip to content

Commit 4e65530

Browse files
committed
apt-get: set global options before command
The `-y` and `-q` options are global options, and can be set before the command that's run; apt-get --help ... Usage: apt-get [options] command apt-get [options] install|remove pkg1 [pkg2 ...] apt-get [options] source pkg1 [pkg2 ...] Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent d56da2b commit 4e65530

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

install.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,13 +498,13 @@ do_install() {
498498
if ! is_dry_run; then
499499
set -x
500500
fi
501-
$sh_c 'apt-get update -qq >/dev/null'
502-
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $pre_reqs >/dev/null"
501+
$sh_c 'apt-get -qq update >/dev/null'
502+
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get -y -qq install $pre_reqs >/dev/null"
503503
$sh_c 'install -m 0755 -d /etc/apt/keyrings'
504504
$sh_c "curl -fsSL \"$DOWNLOAD_URL/linux/$lsb_dist/gpg\" -o /etc/apt/keyrings/docker.asc"
505505
$sh_c "chmod a+r /etc/apt/keyrings/docker.asc"
506506
$sh_c "echo \"$apt_repo\" > /etc/apt/sources.list.d/docker.list"
507-
$sh_c 'apt-get update -qq >/dev/null'
507+
$sh_c 'apt-get -qq update >/dev/null'
508508
)
509509
pkg_version=""
510510
if [ -n "$VERSION" ]; then
@@ -546,7 +546,7 @@ do_install() {
546546
if ! is_dry_run; then
547547
set -x
548548
fi
549-
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $pkgs >/dev/null"
549+
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get -y -qq install $pkgs >/dev/null"
550550
)
551551
echo_docker_as_nonroot
552552
exit 0

rootless-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ checks() {
128128
# uidmap dependency check
129129
if ! command -v newuidmap >/dev/null 2>&1; then
130130
if command -v apt-get >/dev/null 2>&1; then
131-
INSTRUCTIONS="apt-get install -y uidmap"
131+
INSTRUCTIONS="apt-get -y install uidmap"
132132
elif command -v dnf >/dev/null 2>&1; then
133133
INSTRUCTIONS="dnf -y install shadow-utils"
134134
elif command -v yum >/dev/null 2>&1; then
@@ -144,7 +144,7 @@ yum -y install shadow-utils46-newxidmap"
144144
if [ -z "$SKIP_IPTABLES" ] && ! command -v iptables >/dev/null 2>&1 && [ ! -f /sbin/iptables ] && [ ! -f /usr/sbin/iptables ]; then
145145
if command -v apt-get >/dev/null 2>&1; then
146146
INSTRUCTIONS="${INSTRUCTIONS}
147-
apt-get install -y iptables"
147+
apt-get -y install iptables"
148148
elif command -v dnf >/dev/null 2>&1; then
149149
INSTRUCTIONS="${INSTRUCTIONS}
150150
dnf -y install iptables"

0 commit comments

Comments
 (0)