how to use GVM (Go Version Manager)

How to Use GVM (Go Version Manager)

GVM (Go Version Manager) is a tool that allows developers to easily install, manage, and switch between multiple versions of the Go programming language on a single system. It simplifies handling different…


This content originally appeared on DEV Community and was authored by kingyou

How to Use GVM (Go Version Manager)

GVM (Go Version Manager) is a tool that allows developers to easily install, manage, and switch between multiple versions of the Go programming language on a single system. It simplifies handling different Go versions for different projects without conflicts.

Installing GVM

To install GVM on your system, follow these steps:

  • First, install the required dependencies:
  sudo apt-get install curl git mercurial make binutils bison gcc build-essential
  • Next, install GVM using the official installer script:
  bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
  • If you use zsh instead of bash, replace bash with zsh in the command above.

After installation, restart your shell or source your profile to load GVM commands.

Installing and Using Go Versions

With GVM installed, you can manage Go versions easily:

  • List all available Go versions:
  gvm listall
  • Install a specific Go version (for example, version 1.4):
  gvm install go1.4
  • To use a specific installed Go version:
  gvm use go1.4 --default

The --default flag sets this version as the default for new terminals.

  • Check which Go versions are installed on your machine:
  gvm list
  • Uninstall a Go version if no longer needed:
  gvm uninstall go1.4

Managing Go Packages with GVM

GVM supports managing package sets to isolate dependencies per Go version or project:

  • Create a new package set:
  gvm pkgset create mypkgset
  • Switch to a package set:
  gvm pkgset use mypkgset
  • List existing package sets:
  gvm pkgset list

This feature helps in keeping project dependencies cleanly separated.

Additional Useful Commands

  • To link the current directory into your GOPATH for development:
  gvm linkthis
  • To view all commands and usage information:
  gvm help

GVM is particularly helpful for Go developers needing to maintain projects on different Go versions without the hassle of manual environment configurations. This tool automatically manages your $GOROOT and $GOPATH environment variables when switching versions, streamlining your Go development workflow.

For detailed usage and latest updates, visit the official GVM GitHub repository.

This guide will get you started with GVM for easy Go version management in your development environment. Happy coding!


This content originally appeared on DEV Community and was authored by kingyou


Print Share Comment Cite Upload Translate Updates
APA

kingyou | Sciencx (2025-12-02T03:49:11+00:00) how to use GVM (Go Version Manager). Retrieved from https://www.scien.cx/2025/12/02/how-to-use-gvm-go-version-manager/

MLA
" » how to use GVM (Go Version Manager)." kingyou | Sciencx - Tuesday December 2, 2025, https://www.scien.cx/2025/12/02/how-to-use-gvm-go-version-manager/
HARVARD
kingyou | Sciencx Tuesday December 2, 2025 » how to use GVM (Go Version Manager)., viewed ,<https://www.scien.cx/2025/12/02/how-to-use-gvm-go-version-manager/>
VANCOUVER
kingyou | Sciencx - » how to use GVM (Go Version Manager). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/12/02/how-to-use-gvm-go-version-manager/
CHICAGO
" » how to use GVM (Go Version Manager)." kingyou | Sciencx - Accessed . https://www.scien.cx/2025/12/02/how-to-use-gvm-go-version-manager/
IEEE
" » how to use GVM (Go Version Manager)." kingyou | Sciencx [Online]. Available: https://www.scien.cx/2025/12/02/how-to-use-gvm-go-version-manager/. [Accessed: ]
rf:citation
» how to use GVM (Go Version Manager) | kingyou | Sciencx | https://www.scien.cx/2025/12/02/how-to-use-gvm-go-version-manager/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.