Getting a lot of cannot find package errors after go install . ./cmd/... command

Hello,

After installing and successfully testing golang on my Slackware 14.2 64bit machine following “Getting started tutorial”, I am experiencing some problems using go install . ./cmd/... command to complete installation of lightning network deamon (for short lnd) written in go.

According to lnd installation guide:

  1. Install Go version higher than 1.8
  2. Setup environment variable

export GOPATH=~/gocode
export PATH=$PATH:$GOPATH/bin

  1. Install Glide
    go get -u github.com/Masterminds/glide
  2. Install lnd itself

git clone GitHub - lightningnetwork/lnd: Lightning Network Daemon ⚡️ $GOPATH/src/github.com/lightningnetwork/lnd
cd $GOPATH/src/github.com/lightningnetwork/lnd
glide install
go install . ./cmd/…

The last command returns a lot of “cannot find package” lines:

tenev@~/gocode/src/github.com/lightningnetwork/lnd$ go install . ./cmd/…
breacharbiter.go:12:2: cannot find package “GitHub - boltdb/bolt: An embedded key/value database for Go.” in any of:
/usr/src/github.com/boltdb/bolt (from $GOROOT)
/home/tenev/gocode/src/github.com/boltdb/bolt (from $GOPATH)

Note: this is not the complete error message but it is like this until the end.

I suspect that I have not setup correctly some environment variable but not sure how to debug it.
Checked above mentioned folders and did not find required packages but also saw that glide install is successfully fetching some packages.

Could you please suggest how to debug this issue?

Try running the file containing the main function and see if you are getting the same errors.
go run main.go

If you are still getting the errors that means you need to check your paths. Recheck if they are pointing to the correct folders.

As I understand https://slackbuilds.org/repository/14.0/development/google-go-lang/ go for slackware might be hopelessly outdated. Please make sure you are running at least version 1.8 as mentioned in your referenced install instructions.

Or how did you install golang?

Tried twice, first time using package prepared for Slackware from Slackbuilds, second time using the binaries from golang and following the “Getting Started Tutorial and Test” to verify installation.

Whats the outoput of go version? What was the output of glide install?

go version

tenev@~/gocode/src/github.com/lightningnetwork/lnd$ go version
go version go1.4.2 gccgo (GCC) 5.3.0 linux/amd64

glide install

> tenev@~/gocode/src/github.com/lightningnetwork/lnd$ glide install
> [INFO]  Downloading dependencies. Please wait...
> [INFO]  --> Found desired version locally github.com/aead/chacha20 d31a916ded42d1640b9d89a26f8abd53cc96790c!
> [INFO]  --> Found desired version locally github.com/aead/siphash e404fcfc888570cadd1610538e2dbc89f66af814!
> [INFO]  --> Found desired version locally github.com/awalterschulze/gographviz 9d8c9780eb4766351ae8489f78cb940cb6e0503d!
> [INFO]  --> Found desired version locally github.com/boltdb/bolt 2f1ce7a837dcb8da3ec595b1dac9d0632f0f99e8!
> [INFO]  --> Found desired version locally github.com/btcsuite/btclog 84c8d2346e9fc8c7b947e243b9c24e6df9fd206a!
> [INFO]  --> Found desired version locally github.com/btcsuite/fastsha256 637e656429416087660c84436a2a035d69d54e2e!
> [INFO]  --> Found desired version locally github.com/btcsuite/go-socks 4720035b7bfd2a9bb130b1c184f8bbe41b6f0d0f!
> [INFO]  --> Found desired version locally github.com/btcsuite/golangcrypto 53f62d9b43e87a6c56975cf862af7edf33a8d0df!
> [INFO]  --> Found desired version locally github.com/btcsuite/websocket 31079b6807923eb23992c421b114992b95131b55!
> [INFO]  --> Found desired version locally github.com/davecgh/go-spew ecdeabc65495df2dec95d7c4a4c3e021903035e5!
> [INFO]  --> Found desired version locally github.com/go-errors/errors 8fa88b06e5974e97fbf9899a7f86a344bfd1f105!
> [INFO]  --> Found desired version locally github.com/golang/protobuf ab9f9a6dab164b7d1246e0e688b0ab7b94d8553e!
> [INFO]  --> Found desired version locally github.com/grpc-ecosystem/grpc-gateway f2862b476edcef83412c7af8687c9cd8e4097c0f!
> [INFO]  --> Found desired version locally github.com/howeyc/gopass bf9dde6d0d2c004a008c27aaee91170c786f6db8!
> [INFO]  --> Found desired version locally github.com/jessevdk/go-flags f88afde2fa19a30cf50ba4b05b3d13bc6bae3079!
> [INFO]  --> Found desired version locally github.com/jrick/logrotate a93b200c26cbae3bb09dd0dc2c7c7fe1468a034a!
> [INFO]  --> Found desired version locally github.com/juju/loggo 8232ab8918d91c72af1a9fb94d3edbe31d88b790!
> [INFO]  --> Found desired version locally github.com/kkdai/bstream f391b8402d23024e7c0f624b31267a89998fca95!
> [INFO]  --> Found desired version locally github.com/lightninglabs/gozmq 0d266ba6d55ea65c18c7a02d8992c89355149e80!
> [INFO]  --> Found desired version locally github.com/lightninglabs/neutrino 6c8f30a130bb170348ceb754ce4204156efe2741!
> [INFO]  --> Found desired version locally github.com/lightningnetwork/lightning-onion 18bf6612a0653a21daf1a08b4a59e54670a524a1!
> [INFO]  --> Found desired version locally github.com/ltcsuite/ltcd 5f654d5faab99ee2b3488fabba98e5f7a5257ee3!
> [INFO]  --> Found desired version locally github.com/miekg/dns 946bd9fbed05568b0f3cd188353d8aa28f38b688!
> [INFO]  --> Found desired version locally github.com/roasbeef/btcd 9978b939c33973be19b932fa7b936079bb7ba38d!
> [INFO]  --> Found desired version locally github.com/roasbeef/btcrpcclient d0f4db8b4dad0ca3d569b804f21247c3dd96acbb!
> [INFO]  --> Found desired version locally github.com/roasbeef/btcutil c3ff179366044979fb9856c2feb79bd4c2184c7a!
> [INFO]  --> Found desired version locally github.com/roasbeef/btcwallet 4f4765c3e3baf4c7b40c311340a076ec83c5ef3a!
> [INFO]  --> Found desired version locally github.com/rogpeppe/fastuuid 6724a57986aff9bff1a1770e9347036def7c89f6!
> [INFO]  --> Found desired version locally github.com/tv42/zbase32 501572607d0273fc75b3b261fa4904d63f6ffa0e!
> [INFO]  --> Found desired version locally github.com/urfave/cli cfb38830724cc34fedffe9a2a29fb54fa9169cd1!
> [INFO]  --> Found desired version locally golang.org/x/crypto 9419663f5a44be8b34ca85f08abc5fe1be11f8a3!
> [INFO]  --> Found desired version locally golang.org/x/net 66aacef3dd8a676686c7ae3716979581e8b03c47!
> [INFO]  --> Found desired version locally golang.org/x/sys ab9e364efd8b52800ff7ee48a9ffba4e0ed78dfb!
> [INFO]  --> Found desired version locally golang.org/x/text 18c65dde6afd36dbc39197ca72008895b8dfbfb6!
> [INFO]  --> Found desired version locally google.golang.org/genproto ee236bd376b077c7a89f260c026c4735b195e459!
> [INFO]  --> Found desired version locally google.golang.org/grpc b3ddf786825de56a4178401b7e174ee332173b66!
> [INFO]  --> Found desired version locally gopkg.in/errgo.v1 442357a80af5c6bf9b6d51ae791a39c3421004f3!
> [INFO]  --> Found desired version locally gopkg.in/macaroon-bakery.v2 04cf5ef151a211d929975161aea7c65f94c90446!
> [INFO]  --> Found desired version locally gopkg.in/macaroon.v2 bed2a428da6e56d950bed5b41fcbae3141e5b0d0!
> [INFO]  Setting references.
> [INFO]  --> Setting version for github.com/howeyc/gopass to bf9dde6d0d2c004a008c27aaee91170c786f6db8.
> [INFO]  --> Setting version for github.com/btcsuite/btclog to 84c8d2346e9fc8c7b947e243b9c24e6df9fd206a.
> [INFO]  --> Setting version for github.com/btcsuite/websocket to 31079b6807923eb23992c421b114992b95131b55.
> [INFO]  --> Setting version for github.com/aead/siphash to e404fcfc888570cadd1610538e2dbc89f66af814.
> [INFO]  --> Setting version for github.com/btcsuite/golangcrypto to 53f62d9b43e87a6c56975cf862af7edf33a8d0df.
> [INFO]  --> Setting version for github.com/davecgh/go-spew to ecdeabc65495df2dec95d7c4a4c3e021903035e5.
> [INFO]  --> Setting version for github.com/btcsuite/go-socks to 4720035b7bfd2a9bb130b1c184f8bbe41b6f0d0f.
> [INFO]  --> Setting version for github.com/go-errors/errors to 8fa88b06e5974e97fbf9899a7f86a344bfd1f105.
> [INFO]  --> Setting version for github.com/golang/protobuf to ab9f9a6dab164b7d1246e0e688b0ab7b94d8553e.
> [INFO]  --> Setting version for github.com/jessevdk/go-flags to f88afde2fa19a30cf50ba4b05b3d13bc6bae3079.
> [INFO]  --> Setting version for github.com/awalterschulze/gographviz to 9d8c9780eb4766351ae8489f78cb940cb6e0503d.
> [INFO]  --> Setting version for github.com/grpc-ecosystem/grpc-gateway to f2862b476edcef83412c7af8687c9cd8e4097c0f.
> [INFO]  --> Setting version for github.com/aead/chacha20 to d31a916ded42d1640b9d89a26f8abd53cc96790c.
> [INFO]  --> Setting version for github.com/boltdb/bolt to 2f1ce7a837dcb8da3ec595b1dac9d0632f0f99e8.
> [INFO]  --> Setting version for github.com/juju/loggo to 8232ab8918d91c72af1a9fb94d3edbe31d88b790.
> [INFO]  --> Setting version for github.com/btcsuite/fastsha256 to 637e656429416087660c84436a2a035d69d54e2e.
> [INFO]  --> Setting version for github.com/lightninglabs/gozmq to 0d266ba6d55ea65c18c7a02d8992c89355149e80.
> [INFO]  --> Setting version for github.com/jrick/logrotate to a93b200c26cbae3bb09dd0dc2c7c7fe1468a034a.
> [INFO]  --> Setting version for github.com/kkdai/bstream to f391b8402d23024e7c0f624b31267a89998fca95.
> [INFO]  --> Setting version for github.com/lightninglabs/neutrino to 6c8f30a130bb170348ceb754ce4204156efe2741.
> [INFO]  --> Setting version for github.com/lightningnetwork/lightning-onion to 18bf6612a0653a21daf1a08b4a59e54670a524a1.
> [INFO]  --> Setting version for github.com/roasbeef/btcd to 9978b939c33973be19b932fa7b936079bb7ba38d.
> [INFO]  --> Setting version for github.com/miekg/dns to 946bd9fbed05568b0f3cd188353d8aa28f38b688.
> [INFO]  --> Setting version for github.com/roasbeef/btcutil to c3ff179366044979fb9856c2feb79bd4c2184c7a.
> [INFO]  --> Setting version for github.com/ltcsuite/ltcd to 5f654d5faab99ee2b3488fabba98e5f7a5257ee3.
> [INFO]  --> Setting version for github.com/roasbeef/btcrpcclient to d0f4db8b4dad0ca3d569b804f21247c3dd96acbb.
> [INFO]  --> Setting version for github.com/roasbeef/btcwallet to 4f4765c3e3baf4c7b40c311340a076ec83c5ef3a.
> [INFO]  --> Setting version for github.com/urfave/cli to cfb38830724cc34fedffe9a2a29fb54fa9169cd1.
> [INFO]  --> Setting version for github.com/tv42/zbase32 to 501572607d0273fc75b3b261fa4904d63f6ffa0e.
> [INFO]  --> Setting version for github.com/rogpeppe/fastuuid to 6724a57986aff9bff1a1770e9347036def7c89f6.
> [INFO]  --> Setting version for golang.org/x/crypto to 9419663f5a44be8b34ca85f08abc5fe1be11f8a3.
> [INFO]  --> Setting version for google.golang.org/genproto to ee236bd376b077c7a89f260c026c4735b195e459.
> [INFO]  --> Setting version for golang.org/x/net to 66aacef3dd8a676686c7ae3716979581e8b03c47.
> [INFO]  --> Setting version for gopkg.in/errgo.v1 to 442357a80af5c6bf9b6d51ae791a39c3421004f3.
> [INFO]  --> Setting version for golang.org/x/text to 18c65dde6afd36dbc39197ca72008895b8dfbfb6.
> [INFO]  --> Setting version for google.golang.org/grpc to b3ddf786825de56a4178401b7e174ee332173b66.
> [INFO]  --> Setting version for golang.org/x/sys to ab9e364efd8b52800ff7ee48a9ffba4e0ed78dfb.
> [INFO]  --> Setting version for gopkg.in/macaroon-bakery.v2 to 04cf5ef151a211d929975161aea7c65f94c90446.
> [INFO]  --> Setting version for gopkg.in/macaroon.v2 to bed2a428da6e56d950bed5b41fcbae3141e5b0d0.
> [INFO]  Exporting resolved dependencies...
> [INFO]  --> Exporting github.com/aead/siphash
> [INFO]  --> Exporting github.com/btcsuite/golangcrypto
> [INFO]  --> Exporting github.com/davecgh/go-spew
> [INFO]  --> Exporting github.com/awalterschulze/gographviz
> [INFO]  --> Exporting github.com/btcsuite/websocket
> [INFO]  --> Exporting github.com/howeyc/gopass
> [INFO]  --> Exporting github.com/golang/protobuf
> [INFO]  --> Exporting github.com/grpc-ecosystem/grpc-gateway
> [INFO]  --> Exporting github.com/jessevdk/go-flags
> [INFO]  --> Exporting github.com/juju/loggo
> [INFO]  --> Exporting github.com/kkdai/bstream
> [INFO]  --> Exporting github.com/btcsuite/btclog
> [INFO]  --> Exporting github.com/jrick/logrotate
> [INFO]  --> Exporting github.com/btcsuite/go-socks
> [INFO]  --> Exporting github.com/btcsuite/fastsha256
> [INFO]  --> Exporting github.com/boltdb/bolt
> [INFO]  --> Exporting github.com/go-errors/errors
> [INFO]  --> Exporting github.com/aead/chacha20
> [INFO]  --> Exporting github.com/lightninglabs/gozmq
> [INFO]  --> Exporting github.com/lightninglabs/neutrino
> [INFO]  --> Exporting github.com/lightningnetwork/lightning-onion
> [INFO]  --> Exporting github.com/ltcsuite/ltcd
> [INFO]  --> Exporting github.com/miekg/dns
> [INFO]  --> Exporting github.com/roasbeef/btcd
> [INFO]  --> Exporting github.com/roasbeef/btcrpcclient
> [INFO]  --> Exporting github.com/roasbeef/btcutil
> [INFO]  --> Exporting github.com/roasbeef/btcwallet
> [INFO]  --> Exporting github.com/rogpeppe/fastuuid
> [INFO]  --> Exporting github.com/tv42/zbase32
> [INFO]  --> Exporting github.com/urfave/cli
> [INFO]  --> Exporting golang.org/x/crypto
> [INFO]  --> Exporting golang.org/x/net
> [INFO]  --> Exporting google.golang.org/genproto
> [INFO]  --> Exporting google.golang.org/grpc
> [INFO]  --> Exporting gopkg.in/errgo.v1
> [INFO]  --> Exporting golang.org/x/sys
> [INFO]  --> Exporting golang.org/x/text
> [INFO]  --> Exporting gopkg.in/macaroon-bakery.v2
> [INFO]  --> Exporting gopkg.in/macaroon.v2
> [INFO]  Replacing existing vendor dependenciesThis text will be hidden

vs.


  1. Glide uses the vednor dir to pin dependencies. Vendoring is only supported since go 1.5 (as experimental feature) and stable since 1.7 IIRC
  2. The program you want to compile does need at least version 1.8 according to its own documentation.

Please install an appropriate version for your system from All releases - The Go Programming Language

Thank you for helping, now it is clear to me what is the problem.

I’ve also saw go1.4.2 but got confused since I downloaded and installed 1.9.3 package.

Actually the root cause is that according to the “Getting started tutorial” I am extracting the binaries of go1.9.3 to /usr/local/go/, then adding this path to my $PATH variable.
The problem is that I already have go with my distribution probably coming with package gccgo (GCC) 5.3.0 linux/amd64 and installed in /usr/bin.
Since /usr/bin is first in my $PATH variable, go1.4.2 is always executed.

After running the command reporting the error using full path to go1.9.3 it was ok.

Thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.