wit-new-machine/apt.go

49 lines
1.4 KiB
Go

package main
import (
"log"
"os"
"go.wit.com/gui"
)
func aptTab() {
aptTab := gui.RawWindow("apt")
box := aptTab.NewBox("aptBox", false)
box.NewButton("apt sources", func() {
if _, err := os.Stat("/etc/apt/sources.list.d/wit.list"); err == nil {
log.Println("apt sources are already configured")
} else {
myGui.CloseToolkit("gocui")
writeRes("resources/", "/etc/", "apt/sources.list")
writeRes("resources/", "/etc/", "apt/sources.list.d/wit.list")
writeRes("resources/", "/etc/", "apt/sources.list.d/debian.list")
doCmd("mkdir /etc/wit/")
writeRes("resources/apt/", "/etc/wit/", "wit.gpg")
doCmd("apt update")
doCmd("apt dist-upgrade")
log.Println("\nYou should reboot now\n")
os.Exit(0)
}
})
box.NewButton("apt-file", func() {
myGui.CloseToolkit("gocui")
doCmd("apt install apt-file")
doCmd("apt-file update")
doCmd("apt-file -x search /libOpenCL.so.1")
// doCmd("apt-file -x search '/libOpenCL.so.1'")
os.Exit(0)
})
box.NewButton("install defaults", func() {
myGui.CloseToolkit("gocui")
doCmd("apt install lsof bash-completion libpam-systemd dbus rbd-nbd golang-go git screen vim " +
"ethstatus iftop ethtool sysstat traceroute whois devscripts automake libtool devscripts " +
"nmap clang rsync bind9utils dnsutils net-tools tcpdump wget curl iputils-ping pciutils " +
"iptables sysbench man usbutils ssh neofetch bc lshw telnet hdparm vrms")
os.Exit(0)
})
}