Should I install Golang 1.8.1 into /usr/local?

I want to install Golang 1.8.1 (the latest version) in UM 16.04 LTS, but the golang package in the repo is several versions behind. The instructions to install Golang tell me to grab the appropriate binary and extract it to /usr/local. Obviously the package manager cannot update, resolve dependencies, or uninstall a local installation like that.

Is it a good idea to circumvent the package manager like this? I’ve been advised not too install things outside the package manager, lest I scatter files all over the system. In this case, though, everything is install into /usr/local/go. To get rid of it I just delete that directory and its contents, then remove it from my PATH.

The other possible way is to find a backport PPA with Golang-1.8.1 for 16.04. I’ve never used a PPA before but it looks simple enough. Is this a better way to do it?

I would definitely suggest using a PPA instead of manually putting stuff into /usr/local/go.

Here is one I found:

1 Like

Thanks. Have you used this PPA before? It looks like it is pretty safe (recent updates and all that), but I just want to be careful before I start downloading files from an unknown repo. It looks decent, it’s just that I’ve never downloaded something from elsewhere than the official repos before. ;m;

BTW, what might be some of the drawbacks of manually putting stuff in /usr/local/? Not being able to manage it with apt or apt-get and having to manage dependency issues manually are the first I think of, but are there other issues? I thought it was a bit strange that the Golang instructions told me to manually put stuff in there, since all the Ubuntu docs I’ve seen tell me to avoid circumventing my package manager (like using checkinstall instead of make install when installing from source).

I haven’t used it myself but I use quite some PPAs that are hosted on Launchpad and I never had any problems.

Exactly, using a PPA avoids you running into dependencies problems and updating the software is just easier.

Okay, that’s good to know! I don’t really expect PPAs to be a problem as long as I don’t blindly use one that is weird, really old, or a testing/unstable branch.

Yeah, updates were another thing I was worried about. Having to delete the entire /usr/local/go directory and manually install the new one for ever update would be a bother. I think I’ll go with the PPA, seems much safer and more convenient.

1 Like

Great, enjoy and have fun! :slight_smile:

@Mechanizoid, don’t forget to mark the right answer as solved.
It helps tremendously readers scouring through the forums to know they can move on to other issues, or to other readers to know at a glance there is a solution to their very same problem on that thread.

Cheers :slight_smile:

1 Like

Oh, thanks for telling me, I didn’t know we could do that. :smiley: My question’s resolved, I’m only wondering which PPA I should use when I take the plunge now, the one orschiro found or longsleep/golang-backports as recommended here.

Well, I guess you could research those two individuals and see which one is more involved in the Golang development.

It shouldn’t matter much which. They are both unofficial backports. The build is essentially the same and chances of future updates are an unknown no matter what promises are made.

The best answer you can probably find from the Go community of programmers. Go to their usual and most populated hangouts and you are bound to find folks who program Go on Ubuntu. They’ll let you know how they handle this rapidly evolving language on a fixed release distro.