From f5b12836904de291873ac110f1f690648ca531c3 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Tue, 16 May 2023 17:52:15 +0000 Subject: [PATCH] fix: try to install debian packages 3 times --- distro/debian/debian.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/distro/debian/debian.go b/distro/debian/debian.go index bb95623..e24afe5 100644 --- a/distro/debian/debian.go +++ b/distro/debian/debian.go @@ -216,20 +216,24 @@ func ContainerCommands(km config.KernelMask) (commands []string) { "/etc/apt/sources.list") } - cmdf("apt-get update") - cmdf("apt-get install -y wget build-essential libelf-dev git") - cmdf("apt-get install -y kmod linux-base") - cmdf("apt-get install -y initramfs-tools") + cmdf("{ apt-get update || apt-get update || apt-get update }") + + packages := "wget build-essential libelf-dev git kmod linux-base " + packages += "initramfs-tools " switch release { case Wheezy: - cmdf("apt-get install -y gcc-4.6") + packages += "gcc-4.6 " } if release < 9 { - cmdf("apt-get install -y module-init-tools") + packages += "module-init-tools " } + cmfd("{ apt-get install -y %s "+ + "|| apt-get install -y %s "+ + "|| apt-get install -y %s }", packages, packages, packages) + cmdf("mkdir -p /lib/modules") return