We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e27ba1a commit a7bf7daCopy full SHA for a7bf7da
apt.go
@@ -111,3 +111,16 @@ func UpgradeAll() (output []byte, err error) {
111
cmd := exec.Command("apt-get", "upgrade", "-y")
112
return cmd.CombinedOutput()
113
}
114
+
115
+// Remove removes a set of packages
116
+func Remove(packs ...*Package) (output []byte, err error) {
117
+ args := []string{"remove", "-y"}
118
+ for _, pack := range packs {
119
+ if pack == nil || pack.Name == "" {
120
+ return nil, fmt.Errorf("apt.Remove: Invalid package with empty Name")
121
+ }
122
+ args = append(args, pack.Name)
123
124
+ cmd := exec.Command("apt-get", args...)
125
+ return cmd.CombinedOutput()
126
+}
0 commit comments