diff --git a/pkg/pkg/rhel.go b/pkg/pkg/rhel.go index 5a6f3582..de122cb7 100644 --- a/pkg/pkg/rhel.go +++ b/pkg/pkg/rhel.go @@ -47,7 +47,7 @@ func (pkg *RHELPackage) Download(ctx context.Context, dir string, force bool) (s return rpmpath, nil } - err := yumDownload(ctx, pkg.Name, dir) + err := yumDownload(ctx, pkg.Name, pkg.Architecture, dir) if err != nil { os.Remove(rpmpath) return "", fmt.Errorf("rpm download: %s", err) diff --git a/pkg/pkg/utils.go b/pkg/pkg/utils.go index 881a2af6..f5626787 100644 --- a/pkg/pkg/utils.go +++ b/pkg/pkg/utils.go @@ -35,15 +35,10 @@ func TarballBTF(ctx context.Context, btf string, out string) error { // RHEL packages // -func yumDownload(ctx context.Context, pkg string, destdir string) error { - +func yumDownload(ctx context.Context, pkg string, arch string, destdir string) error { stderr := &bytes.Buffer{} - - destDirParam := fmt.Sprintf("--downloaddir=%s", destdir) - - binary, args := utils.SudoCMD("yum", "install", "-y", "--downloadonly", destDirParam, pkg) + binary, args := utils.SudoCMD("yumdownloader", "--archlist="+arch, "--destdir="+destdir, pkg) cmd := exec.CommandContext(ctx, binary, args...) - cmd.Stdout = os.Stdout cmd.Stderr = stderr