Install Go on Ubuntu (terminal)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey there it's Jim from jaku and I want to take a look at downloading go today and we're going to use the terminal in this tutorial because it's the fastest way to get go on to our boon 218 laptop so first let's go to the golang.org website and let's check out the Downloads button here and you can see that the most recent version of go for Linux is go 1.1 4.2 so I can right click on this and I can copy the link location here and then let's flip over to our terminal and first I'm going to CD or change directories into our downloads folder because our downloads folder should be empty and then I'm going to do aw get on that URL so once that's complete if I list the files in this folder again you see that we have this go 114 tarball so it's a in G zip file which is basically compressed so we can unpack that file by running a tar and we'll pass some flags will extract unzip passive verbose file output and run it on that file here press ENTER and if we list the files again now we have a go folder here and inside that go folder if we were to look in there you'll see there are a bunch of files and folders one of which is bin and inside the bin folder if you take a look there is a go binary and this is the actual thing that executes go so we could actually just run this code right here by running dot slash go bingo and you can see that it outputs all these commands and some help tips and some commands for go so that's the go language right there and now what we want to do is we want to move this into a location that allows us to run it anywhere on our computer without having to type this full path like this so right now we have to do dot go bingo and if we were in a different folder besides the Downloads we'd have to adjust this location to point to that Downloads folder so what we're going to do here is we're going to move the go folder we're going to move it to a location that's user local now this folder requires elevated permission so we're gonna have to run this as a super user so path sudu in front of that command and press enter and now if you were to list the files in user local you should see that go belongs in there now so for some of you that might be all you need to do so if you were to type go you might get something like this now if you're not seeing that if you see something like the computer not recognizing the go command then what you need to do is you need to add the go binary to your paths so you can do that by adding it to a file in your home directory called bash RC so we're gonna open that with a command line text editor called VI and I'm gonna use the tilde character that means home directory it's a shortcut and then I'm going to type dot bash RC and that's going to open a file so right now we're in a file it looks a little funny but this is a file and I'm gonna do shift G to hop to the bottom of the file here and then I'll press o to insert a new line below the last line there and I'll just press ENTER again and then I'll add a comment something like add go to path and then below that I'll just say export path equals dollar sign path : user local go bit and then I can do a ctrl C to get out insert mode and then if I type : WQ that will write to the file and quit out of the file now if we want to make sure that that changed in that file is taken place we have to come in here and we have to do something called sourcing that file so type source on that file and now you should be able to type go if you couldn't previously and you should see the same output that we're seeing here if you wanted to check where your go is installed too you could type which go and that shows the location that we installed it to previously we've moved this to the user local go pin and if you want to know the version of go you're on just type go version and they'll let you know that you're currently on 114 - that should be all you need to get started with go you don't really need to set your go path or your go route anymore with the new go modules that we're using with the newer versions of go stay tuned to our channel for some go tutorials coming up very shortly thanks for watching this and take care
Info
Channel: Jantcu
Views: 27,046
Rating: undefined out of 5
Keywords: Go, Golang, Install, Latest, Stable, Version, 1.14, Ubuntu, Unity, Linux, Terminal, Commandline, Go Modules, GOPATH, GOROOT, PATH, /usr/local, Binary, Execute, Get, Download, Fresh
Id: 0e_C1B8fDvg
Channel Id: undefined
Length: 4min 31sec (271 seconds)
Published: Fri May 01 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.