apt sources

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2023-04-22 15:19:28 -05:00
parent 0950bb4ef8
commit d259bd2ccd
10 changed files with 26 additions and 11 deletions

View File

@ -6,6 +6,7 @@ VERSION = $(shell cat resources/VERSION)
# PATH=/usr/bin:$PATH go version
build:
git pull
# reset
GO111MODULE="off" go build -v
./wit-new-machine

View File

@ -1,20 +1,17 @@
deb http://mirrors.wit.org/debian/ sid main contrib non-free
deb-src http://mirrors.wit.org/debian/ sid main contrib non-free
# deb http://mirrors.wit.org/debian/ sid main contrib non-free
# deb-src http://mirrors.wit.org/debian/ sid main contrib non-free
# deb http://deb.debian.org/debian experimental main
# apt -t experimental install xrandr
<<<<<<< HEAD
# INFO: http://deb.debian.org/
# NO_PUBKEY 5A88D659DCB811BB
# deprecated: apt-key adv --keyserver keyring.debian.org --recv-keys 5A88D659DCB811BB
# use: apt install debian-ports-archive-keyring
deb http://deb.debian.org/debian unstable main contrib non-free
deb http://deb.debian.org/debian-debug unstable-debug main contrib non-free
deb http://deb.debian.org/debian-ports unstable main contrib non-free
# deb http://deb.debian.org/debian unstable main contrib non-free
# deb http://deb.debian.org/debian-debug unstable-debug main contrib non-free
# deb http://deb.debian.org/debian-ports unstable main contrib non-free
=======
>>>>>>> 90a3833 (APT: add files for apt)
###################### apt fallback to cogentco.com ###########################
#deb http://mirror.cogentco.com/debian/ sid main contrib non-free
#deb-src http://mirror.cogentco.com/debian/ sid main contrib non-free

View File

@ -35,6 +35,11 @@ var padding *gui.Node
var firefox *gui.Node
var resolv *gui.Node
func writeRes(indir string, outdir string, name string) {
tmp, _ := res.ReadFile(indir + name)
ioutil.WriteFile(outdir + name, tmp, 0644)
}
func mainTab(n *gui.Node) {
var g *gui.Node
@ -56,7 +61,18 @@ func mainTab(n *gui.Node) {
rn := newTab.NewGroup("Local Linux Settings")
rn.NewButton("apt sources", func () {
xterm("cd ~/jcarr/setup; make setup-apt-sources; make setup-apt-file")
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("apt update")
doCmd("apt dist-upgrade")
log.Println("\nYou should reboot now\n")
os.Exit(0)
}
})
rn.NewButton("apt update", func () {
myGui.CloseToolkit("gocui")
@ -96,8 +112,9 @@ func mainTab(n *gui.Node) {
if _, err := os.Stat("/etc/default/grub.d/wit.cfg"); err == nil {
log.Println("Grub is already configured")
} else {
grub, _ := res.ReadFile("resources/grub.d/wit.cfg")
ioutil.WriteFile("/etc/default/grub.d/wit.cfg", grub, 0644)
writeRes("resources/", "/etc/default/", "grub.d/wit.cfg")
// grub, _ := res.ReadFile("resources/grub.d/wit.cfg")
// ioutil.WriteFile("/etc/default/grub.d/wit.cfg", grub, 0644)
doCmd("update-grub")
}
os.Exit(0)