diff options
| author | Jeff Carr <[email protected]> | 2025-10-16 07:18:40 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-16 07:18:40 -0500 |
| commit | ad22a6b7cb41135aba0d87f5edcf4719c00558e3 (patch) | |
| tree | 4753f781a73fd5bbf197529a882bfde069e1c8e9 | |
| parent | ce5abfa2798af36acba15d3c5ccea03bc422d0b2 (diff) | |
| -rw-r--r-- | apt.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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") |
