Page 1 of 1

$PATH not found

Posted: Thu May 16, 2024 2:19 pm
by devildog

Hi Guys ...

Am trying to set up "go" which needs a path set to /usr/local/go

Here is the output of $PATH (pictured) on a clean (no savefile) boot...

# $PATH
sh: /usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/opt/qt5/bin: No such file or directory
#

^^ is this caused by the trailing " : " after the qt5/bin ? or is there something I'm missing?

pathprobs901.jpg
pathprobs901.jpg (22.09 KiB) Viewed 832 times

PS thanks for posting compiz sfs - really cant live without it !


Re: $PATH not found

Posted: Thu May 16, 2024 2:33 pm
by fredx181

To show the PATH, run: echo $PATH


Re: $PATH not found

Posted: Thu May 16, 2024 3:54 pm
by devildog

Thanks Fred - learn something every day!

So... to add GO to my path ... edit /etc/profile and modify the standard path line?

# standard path
PATH="/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/go/bin"

^^ This does seem to work...

# echo $PATH
/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/go/bin:/opt/qt5/bin
#

# whereis go
go: /usr/local/go /usr/local/go/bin/go
#

vv Ha! We posted at the same time.

Yes I see it - an export will work without the mod to /etc/profile

# go version
go version go1.22.3 linux/amd64
#


Re: $PATH not found

Posted: Thu May 16, 2024 4:02 pm
by fredx181
devildog wrote: Thu May 16, 2024 3:54 pm

Thanks Fred - learn something every day!

So... to add GO to my path ... edit /etc/profile and modify the standard path line?

# standard path
PATH="/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/go/bin"

I'm not sure, perhaps sufficient to run first with export; export PATH="/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/go/bin:$PATH"
(if the go binary is in reality located in /usr/local/go/bin/)
And then staying in the same terminal do the required go commands.


Re: $PATH not found

Posted: Thu May 16, 2024 7:16 pm
by fredx181

@devildog Probably you need also to set GOPATH variable : https://go.dev/wiki/GOPATH#gopath-variable