How to upgrade Go to 1.18

I need to upgrade the version of Go from the installed version 1.16 to the latest 1.18.

There are several tutorials on how to install, but I haven’t found any for upgrade specifically, as there were for PHP.

The reason I ask is because Go is already installed, and I want to make sure I’d correctly upgrade if there’s a process already in place.

dnf list golang gives me:

Last metadata expiration check: 1:09:34 ago on Fri 22 Apr 2022 07:05:03 PM EDT.
Installed Packages
golang.x86_64                                                                         1.16.12-1.module_el8.5.0+2604+960c7771                                                                         @appstream

Or, do I re-install from scratch like this?

1 Like

The Go is a “rolling application stream”:

The Retired Red Hat Enterprise Linux 8 Rolling Application Streams - Red Hat Customer Portal shows that it has updated 1.11 → 1.12 → 1.13 → 1.16 during lifetime of RHEL 8.

CentOS Stream 8 has currently Go 1.17, so one might get 1.17 in Alma 8.6.

1 Like

Thank you very much. I’m still learning Alma, and this helps me a lot. So, the more I learn of RedHat, the more I’ll learn of Alma?

The more you learn RedHat this will cover Fedora/Alma/Rocky/CentOS and other RPM based distribution.

And for latest Go 1.18 if you want to use that you will have compile for yourself.

If you want Go or any other latest rpm package you will have learn how to write rpm spec file, how to use rpmbuild, mock like builder tools. That way you can build your rpm file and use it when RHEL, Alma, Rocky won’t provide latest updates because they are 1:1 to RHEL.

1 Like