How can I list all installed packages via goinstall? I need this to reinstall all packages installed on one computer to a different computer.
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.
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.
go list '...'
for it to work. –
Disproportionation go list all
also works in place of ...
. See go help packages
for how to specify package names such as all
, ...
, std
, etc. –
Biblicist all
as a package name changed meaning with modules. See go help packages
: ""all" expands to all packages found in all the GOPATH trees. When using modules, "all" expands to all packages in the main module and their dependencies, including dependencies needed by tests of any of those." –
Biblicist 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.
I'm not sure there's a way to do it through goinstall, but there should be a list under $GOROOT/goinstall.log.
© 2022 - 2024 — McMap. All rights reserved.
goinstall
was only pre-Go 1.0 and hasn't existed for years; many of these answer are no longer applicible. – Biblicist