From ad22a6b7cb41135aba0d87f5edcf4719c00558e3 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 16 Oct 2025 07:18:40 -0500 Subject: use sudo --- apt.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apt.go b/apt.go index 8cdfc41..eb09d09 100644 --- a/apt.go +++ b/apt.go @@ -13,7 +13,7 @@ import ( ) func AptInstall(pkgname string) (*cmd.Status, error) { - cmd := []string{"apt-get", "install", "-y", pkgname} + cmd := []string{"sudo", "apt-get", "install", "-y", pkgname} log.Info("Running:", cmd) return fhelp.RunRealtimeError(cmd) } @@ -29,7 +29,7 @@ func AptRemove(pkgname string) (*cmd.Status, error) { if pkgname == "mirrors.wit.com" { return nil, nil } - cmd := []string{"apt-get", "remove", "-y", pkgname} + cmd := []string{"sudo", "apt-get", "remove", "-y", pkgname} log.Info("Running:", cmd) return fhelp.RunRealtimeError(cmd) } @@ -46,7 +46,7 @@ func AptRemoveOrExit(pkgname string) error { // -o Dir::Etc::sourceparts=/dev/null \ // -o APT::Get::List-Cleanup=0 func AptUpdate() error { - cmd := []string{"apt-get", "update"} + cmd := []string{"sudo", "apt-get", "update"} cmd = append(cmd, "-o", "Dir::Etc::sourcelist=/etc/apt/sources.list.d/wit.list") cmd = append(cmd, "-o", "Dir::Etc::sourceparts=/dev/null") cmd = append(cmd, "-o", "APT::Get::List-Cleanup=0") -- cgit v1.2.3