Skip to content

Instantly share code, notes, and snippets.

@travisjeffery
Last active October 23, 2019 10:39
Show Gist options
  • Save travisjeffery/0b6196f46baaea10333ef82fe945eccc to your computer and use it in GitHub Desktop.
Save travisjeffery/0b6196f46baaea10333ef82fe945eccc to your computer and use it in GitHub Desktop.
Fixing golang/dep's "unable to update checked out version" issue

If you're using golang/dep, and for an unexplained reason running dep ensure errors:

unable to update checked out version: : command failed: [git checkout 019ae5ada31de202164b118aee88ee2d14075c31]: exit status 1

You have to remove the dep from your Gopkg.lock file. This way Gopkg won't look for the missing ref.

And then dep ensure again.

If that still doesn't work, and you're running 0.3.2 or earlier then try removing your cache:

$ rm -rf $GOPATH/pkg/dep/sources/

And then dep ensure again.

--

The issue is likely that the/a project you depend on has forced pushed over the ref dep has cached (which it stores in $GOPATH/pkg/dep/sources/*).

The Kubernetes project is particularly fond of force pushing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment