Skip to content

Commit

Permalink
Force install dependencies in old Debian with expired keys
Browse files Browse the repository at this point in the history
This change is the same as #33915
but for the rest of the Beats.
  • Loading branch information
rdner committed Mar 24, 2023
1 parent b0e0e95 commit e407fc1
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions dev-tools/mage/pkgdeps.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,23 @@ func installDependencies(arch string, pkgs ...string) error {
}
}

if err := sh.Run("apt-get", "update"); err != nil {
// TODO: This is only for debian 7 and should be removed when move to a newer OS. This flag is
// going to be used unnecessary when building using non-debian7 images
// (like when making the linux/arm binaries) and we should remove it soonish.
// See https://github.com/elastic/beats/v7/issues/11750 for more details.
if err := sh.Run("apt-get", "update", "-o", "Acquire::Check-Valid-Until=false"); err != nil {
return err
}

params := append([]string{"install", "-y", "--force-yes",
"--no-install-recommends",

// Journalbeat is built with old versions of Debian that don't update
// their repositories, so they have expired keys.
params := append([]string{
// Due to the expired GPG keys in the old Debian version we must use `--force-yes` additionally to `-y`.
"install", "-y", "--force-yes",
// Allow unauthenticated packages.
// This was not enough: "-o", "Acquire::Check-Valid-Until=false",
"--allow-unauthenticated",
"--no-install-recommends",
}, pkgs...)

return sh.Run("apt-get", params...)
}

Expand Down

0 comments on commit e407fc1

Please sign in to comment.