D R
D R

Reputation: 22492

Get a list of all installed packages in Go

How can I list all installed packages via goinstall? I need this to reinstall all packages installed on one computer to a different computer.

Upvotes: 5

Views: 9706

Answers (3)

Dave C
Dave C

Reputation: 7878

Most answers here are for pre-Go 1.0 which is several years old and the answers are no longer applicable to working Go installations.

The simple answer is go list ... (as with other go sub-commands three literal periods match all packages). That will list every package on the system. See go list -h for other uses of this versatile command.

Dave Cheney also has a related blog article: go list, your Swiss army knife.

Upvotes: 12

Jesse
Jesse

Reputation: 2908

There is a list under $GOROOT/goinstall.log If you want to install all the packages on an different computer just copy the file across and run,

goinstall -a

and goinstall will read this file and install all packages listed in it.

Upvotes: 3

Evan Shaw
Evan Shaw

Reputation: 24547

I'm not sure there's a way to do it through goinstall, but there should be a list under $GOROOT/goinstall.log.

Upvotes: 0

Related Questions