Skip to content

Gdrive installation

Q-engineering edited this page Aug 11, 2022 · 3 revisions

⛔ Not applicable for the GPIO version


👉 If you use our image it's already installed.

Gdrive is a command-line tool for managing your Google Gdrive from the Raspberry Pi.

However, if you want to install it on another RPi, here are the steps.
Start with the installation of Googles GO.

32-bit OS

$ wget https://go.dev/dl/go1.17.7.linux-armv6l.tar.gz
$ sudo tar -C /usr/local -xzf go1.17.7.linux-armv6l.tar.gz
$ export PATH=$PATH:/usr/local/go/bin
# check the version
$ go version
# output go version go1.17.7 linux/arm

64-bit OS

$ wget https://go.dev/dl/go1.17.7.linux-arm64.tar.gz
$ sudo tar -C /usr/local -xzf go1.17.7.linux-arm64.tar.gz
$ export PATH=$PATH:/usr/local/go/bin
# check the version
$ go version
# output go version go1.17.7.7 linux/arm64

The next step is building gdrive.

$ go get github.com/prasmussen/gdrive
$ cd ~/go/bin
$ sudo cp ./gdrive /usr/local/bin

Authorization key

The next step is getting the authorization key from Google. With the key in place, you can access your Gdrive.
The key is only valid for the current Raspberry Pi and is located at /home/pi/.gdrive
Note that everyone with access to this file has access to your Gdrive. Be careful.

Give the command $ gdrive about and copy-paste the URL in your browser.
output image

After logging into your Google account, you will be asked if you want to give your project access to the gdrive.
output image
output image
Once allowed, you get a unique code that can be copy-pasted back to the terminal screen.
output image

Now your gdrive is up and running. You can test it with the $ gdrive list command.

Clone this wiki locally