0

I tried installing lnd using the commands shown in the installation guide. I used these commands:

git clone https://github.com/lightningnetwork/lnd
cd lnd
make install

but when I try running the lnd command, I get this:

Command 'lnd' not found

I have go1.18.1 installed. I did execute these commands, but nothing changed:

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

Here are the $GOPATH and $PATH variables:

echo $GOPATH 
/usr/local/go
echo $PATH
/home/ayoub/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/ayoub/.dotnet/tools:/usr/local/go/bin:/usr/local/go/bin

How can I solve this issue? I am running Ubuntu 20.04.

edit: Here is the output of sudo make install:

go install -v -tags="" -ldflags " -s -w -X github.com/lightningnetwork/lnd/build.Commit=v0.14.3-beta -X github.com/lightningnetwork/lnd/build.CommitHash=bd0c46b4fcb027af1915bd67a3da70e8ca5c6efe -X github.com/lightningnetwork/lnd/build.GoVersion=go1.18.1 -X github.com/lightningnetwork/lnd/build.RawTags=" github.com/lightningnetwork/lnd/cmd/lnd
AidenFive
  • 25
  • 4
  • 1) What was the output from `make install` - were there any error messages? 2) you must have done something in between `export GOPATH=~/go` and `echo $GOPATH` to get `/usr/local/go` instead of `/home/ayoub/go` - what did you do exactly? 3) What is the output of `type go`? – RedGrittyBrick May 12 '22 at 12:42
  • 1) I added the output in the question 2) I had `GOPATH` written in my `~/.bashrc`, but even after removing it and re running the `export GOPATH=~/go` command nothing changed 3) the output of `type go` is `go is /usr/local/go/bin/go` – AidenFive May 12 '22 at 13:11

1 Answers1

0

Since /usr/local/go/bin is in your path, that is probably where you should have go install the programs it compiles. However it isn't clear how you have go set up. Normally the go language tools would be kept separate from the go programs you compile and install.

Nevertheless, if the make command didn't emit error messages, go has compiled lnd and installed it somewhere (usually based on whatever value you had assigned to $GOPATH at that time).

I would find lnd using the following commands ...

find /home/ayoub -name lnd
find /usr/local -name lnd

and then mv it to /usr/local/go/bin/lnd

I would also check ownership and permissions.

RedGrittyBrick
  • 24,039
  • 3
  • 23
  • 47