Skip to content

Instantly share code, notes, and snippets.

@stanbar
Last active September 15, 2023 00:09
Show Gist options
  • Save stanbar/028035ef5cfd3968f653b4b124f147bd to your computer and use it in GitHub Desktop.
Save stanbar/028035ef5cfd3968f653b4b124f147bd to your computer and use it in GitHub Desktop.
Keybase Raspberry Pi Raspbian installator
echo go get keybase && \
go get github.com/keybase/client/go/keybase && \
echo go build keybase && \
go build -tags production github.com/keybase/client/go/keybase && \
sudo mv keybase /usr/bin/ && \
echo go build kbfsfuse && \
go build -tags production github.com/keybase/client/go/kbfs/kbfsfuse && \
sudo mv kbfsfuse /usr/bin/ && \
echo go build git-remote-keybase && \
go build -tags production github.com/keybase/client/go/kbfs/kbfsgit/git-remote-keybase && \
sudo mv git-remote-keybase /usr/bin/ && \
echo go build redirector && \
go build -tags production github.com/keybase/client/go/kbfs/redirector && \
sudo mv redirector /usr/bin/keybase-redirector && \
sudo mkdir -p /opt/keybase && \
sudo wget -q https://raw.githubusercontent.com/keybase/client/master/packaging/linux/crypto_squirrel.txt -P /opt/keybase/ && \
sudo wget -q https://raw.githubusercontent.com/keybase/client/master/packaging/linux/post_install.sh -P /opt/keybase/ && \
echo installing systemd services && \
sudo wget -q https://raw.githubusercontent.com/keybase/client/master/packaging/linux/systemd/keybase.service -P /usr/lib/systemd/user/ && \
sudo wget -q https://raw.githubusercontent.com/keybase/client/master/packaging/linux/systemd/kbfs.service -P /usr/lib/systemd/user/ && \
sudo wget -q https://raw.githubusercontent.com/keybase/client/master/packaging/linux/systemd/keybase-redirector.service -P /usr/lib/systemd/user/ && \
chmod +x /opt/keybase/post_install.sh && \
/opt/keybase/post_install.sh && \
curl https://github.com/keybase/client/blob/master/packaging/linux/run_keybase > run_keybase && \
chmod +x ./run_keybase && \
./run_keybase -g
@wasdee
Copy link

wasdee commented Apr 20, 2022

here is an error.

go get keybase
go: go.mod file not found in current directory or any parent directory.
        'go get' is no longer supported outside a module.
        To build and install a command, use 'go install' with a version,
        like 'go install example.com/cmd@latest'
        For more information, see https://golang.org/doc/go-get-install-deprecation
        or run 'go help get' or 'go help install'.

@netbob
Copy link

netbob commented May 21, 2022

Getting different errors on the latest Ubuntu (22.04 LTS) on raspberry pi 4 8gb

cannot find package "github.com/btcsuite/btcutil/bech32" in any of:
/usr/lib/go-1.18/src/github.com/btcsuite/btcutil/bech32 (from $GOROOT)
/home/user/go/src/github.com/btcsuite/btcutil/bech32 (from $GOPATH)
package stathat.com/c/ramcache: unrecognized import path "stathat.com/c/ramcache": https fetch: Get "https://stathat.com/c/ramcache?go-get=1": dial tcp 0.0.0.0:443: connect: connection refused
cannot find package "github.com/stellar/go/build" in any of:
/usr/lib/go-1.18/src/github.com/stellar/go/build (from $GOROOT)
/home/user/go/src/github.com/stellar/go/build (from $GOPATH)
cannot find package "github.com/stellar/go/clients/horizon" in any of:
/usr/lib/go-1.18/src/github.com/stellar/go/clients/horizon (from $GOROOT)
/home/user/go/src/github.com/stellar/go/clients/horizon (from $GOPATH)

@GwynethLlewelyn
Copy link

@wasdee with newer versions of go (> 1.16 I think) go get ... doesn't work as before, since the new modular approach does not rely on a fixed structure on the filesystem (e.g. the old ~/go/repository-name/package-name format). Instead, go applications can be built from any directory whatsoever.

One way of overcoming this issue is to replicate the 'old' method and use git clone to get at least the base client code in place. So, instead of those two first lines, try the following:

mkdir -p ~/go/github.com/keybase
cd ~/go/github.com/keybase
git clone https://github.com/keybase/client
cd ~/go/github.com/keybase

Then start from line 4 onwards as described, i.e. echo go build keybase && go build -tags...

There is a catch at the very end: curl https://github.com/keybase/client/blob/master/packaging/linux/run_keybase > run_keybase will actually retrieve an HTML file for the page hosting the run_keybase script, not the script itself. To get that, it's better to use something like:

sudo wget -q https://raw.githubusercontent.com/keybase/client/master/packaging/linux/run_keybase -P /usr/bin && \
sudo chmod +x ./run_keybase

This should retrieve the script proper.

As an extra bonus: once I had the Keybase commands compiled for ARM64 on the Raspberry Pi, it was easy enough to re-use them on a Synology NAS as well :-)

@wasdee
Copy link

wasdee commented Nov 17, 2022

@wasdee with newer versions of go (> 1.16 I think) go get ... doesn't work as before, since the new modular approach does not rely on a fixed structure on the filesystem (e.g. the old ~/go/repository-name/package-name format). Instead, go applications can be built from any directory whatsoever.

One way of overcoming this issue is to replicate the 'old' method and use git clone to get at least the base client code in place. So, instead of those two first lines, try the following:

mkdir -p ~/go/github.com/keybase
cd ~/go/github.com/keybase
git clone https://github.com/keybase/client
cd ~/go/github.com/keybase

Then start from line 4 onwards as described, i.e. echo go build keybase && go build -tags...

There is a catch at the very end: curl https://github.com/keybase/client/blob/master/packaging/linux/run_keybase > run_keybase will actually retrieve an HTML file for the page hosting the run_keybase script, not the script itself. To get that, it's better to use something like:

sudo wget -q https://raw.githubusercontent.com/keybase/client/master/packaging/linux/run_keybase -P /usr/bin && \
sudo chmod +x ./run_keybase

This should retrieve the script proper.

As an extra bonus: once I had the Keybase commands compiled for ARM64 on the Raspberry Pi, it was easy enough to re-use them on a Synology NAS as well :-)

thank you.
I did found a way to compile it successfully for a while. Here is how i compile it.

git clone https://github.com/keybase/client ~/Downloads/client
cd ~/Downloads/client/packaging/linux
mkdir build
KEYBASE_BUILD_ARM_ONLY=1 KEYBASE_SKIP_32_BIT=1 ./build_binaries.sh production build

sudo mv build/binaries/arm64/usr/bin/keybase /usr/bin/ 

echo installing systemd services && \
sudo wget -q https://raw.githubusercontent.com/keybase/client/master/packaging/linux/systemd/keybase.service -P /usr/lib/systemd/user/
systemctl --user enable /usr/lib/systemd/user/keybase.service

@CooperGerman
Copy link

Hi @wasdee , do you still use this script nowadays ? I don't seems to be able to compile on a rpi4 using your instructions ... I'm stuck a some cgo-gcc-export-header-prolog:31:14: error: size of array ‘_check_for_64_bit_pointer_matching_GoInt’ is negative error

@wasdee
Copy link

wasdee commented Sep 15, 2023

@CooperGerman im not using it much today. the script remains the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment