Search code examples
google-cloud-platformgoogle-apisafe-browsingsafe-browsing-api

Why am I receiving an 'sbserver not found' error when attempting to set up Google Safe Browsing Database?


I reached this GitHub repo. about google safe browsing database.

I have never used go, but I think it is required now. So I installed it using:

sudo apt install golang-go

Then, I followed the instructions in the GitHub page. I executed:

go get github.com/google/safebrowsing

But nothing installed in the path I was executing the command from. However, I proceeded to:

export PATH=$PATH:$GOPATH/bin

Then the manual says, run the following command (which is two lines, I executed the first line, then I press enter, then nothing changes. Then executed the second line separately:

go get github.com/google/safebrowsing/cmd/sbserver
sbserver -apikey $APIKEY

After executing the second line, I got this error:

Command 'sbserver' not found, did you mean:

  command 'sxserver' from deb sx
  command 'sb_server' from deb spambayes
  command 'ssserver' from deb shadowsocks

Try: sudo apt install <deb name>

Can you please point to me what is wrong? How to install google safe browsing database?


Solution

  • Your PATH is wrong. You will find sbserver in $GOPATH/bin.

    Try ${GOPATH}/bin/sbserver -apikey $APIKEY

    If that does not work, then follow the Go installation instructions and make sure that your Go environment variables are correct.

    GOPATH should look like /home/myname/go or something else that looks normal.

    Your PATH should contain ${GOPATH}/bin