From 004f316161a16e5fdd4060b4b30ee06535c67358 Mon Sep 17 00:00:00 2001 From: Abtin Date: Fri, 17 Jun 2022 12:01:09 -0400 Subject: [PATCH] Fix apt command syntax (#1458) --- v2/internal/system/packagemanager/apt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2/internal/system/packagemanager/apt.go b/v2/internal/system/packagemanager/apt.go index a01c8b03df2..a650c754f27 100644 --- a/v2/internal/system/packagemanager/apt.go +++ b/v2/internal/system/packagemanager/apt.go @@ -65,7 +65,7 @@ func (a *Apt) PackageInstalled(pkg *Package) (bool, error) { if pkg.SystemPackage == false { return false, nil } - cmd := exec.Command("apt", "-qq", "list", pkg.Name) + cmd := exec.Command("apt", "list", "-qq", pkg.Name) var stdo, stde bytes.Buffer cmd.Stdout = &stdo cmd.Stderr = &stde @@ -79,7 +79,7 @@ func (a *Apt) PackageAvailable(pkg *Package) (bool, error) { if pkg.SystemPackage == false { return false, nil } - stdout, _, err := shell.RunCommand(".", "apt", "-qq", "list", pkg.Name) + stdout, _, err := shell.RunCommand(".", "apt", "list", "-qq", pkg.Name) // We add a space to ensure we get a full match, not partial match output := a.removeEscapeSequences(stdout) installed := strings.HasPrefix(output, pkg.Name)