Guides 11792 Published by

This quick guide walks you through setting up Gaucho on a fresh Ubuntu 20.04 machine, starting with installing Git, Go, and the build tools that the program needs to compile. After pulling the source from GitHub it explains why cloning is necessary instead of an apt package and gives clear commands for building a statically linked binary with Go and placing it in /usr/local/bin. The article also shows how to confirm the installation by running gaucho --help and notes typical pitfalls such as missing Go, conflicting libraries, or permission issues on the bin directory. In short, once you follow these steps you’ll have a fully functional native Gaucho binary ready for use across your system.



Install Gaucho on Ubuntu 20.04 – No‑Nonsense Steps

Got a fresh Ubuntu 20.04 box and want Gaucho running in minutes? Here’s the straight‑up path, with a few “why” notes so you know why each step matters.

Prerequisites – What You Need
  • Git – to pull the repo.
  • Go (1.18 +) – Gaucho is written in Go, so you need a recent compiler.
  • Build Essentials – GCC and make are handy for any native dependencies.
sudo apt update
sudo apt install -y git golang-go build-essential

Why bother? The build-essential package brings the C toolchain that Go sometimes falls back on when linking static binaries. Skipping it will leave you staring at an “undefined reference” error later.

Grab the Source Code – Why Clone Instead of Apt

There’s no official Ubuntu package for Gaucho yet, so you’ll have to fetch it from GitHub:

git clone https://github.com/gaucho-dev/gaucho.git
cd gaucho

Cloning gives you the latest commit and lets you tweak the code if needed. If you had tried apt install gaucho, you’d get nothing – the repository doesn’t even list it.

Build with Go – Step‑by‑Step, Why Each Command Matters

1. Set the Go workspace (optional but tidy):

   export GOPATH=$HOME/go
   mkdir -p $GOPATH/src

2. Build the binary:

   go build -o gaucho .

go build compiles everything in the current directory (.) and outputs a single statically linked executable called gaucho. If you skip the -o, Go will name it after the package, which can be confusing.

3. Move the binary to a location in $PATH:

   sudo mv gaucho /usr/local/bin/

Putting it in /usr/local/bin/ makes it discoverable system‑wide. Running gaucho --version from any shell will now work.

Verify the Installation – How to Check It Works
gaucho --help

You should see a help menu with flags like --config, --port. If that appears, congratulations: Gaucho is on your system and ready for action. If you get “command not found”, double‑check /usr/local/bin/ is in your $PATH.

Common Gotchas – Real‑World Snags and Fixes
  • Missing Go

I ran into this after a clean install: go: command not found. I forgot to add the golang-go package. Installing it with apt fixes the problem.

  • Dependency Conflicts

While building, an older libssl caused cannot find -lcrypto. Removing any stale libssl-dev packages before installing Go resolved that.

  • Permissions on /usr/local/bin

If you’re not root, use sudo mv or add the binary to $HOME/.local/bin/ and prepend that directory to your PATH.

That’s it. Gaucho is now compiled from source and available everywhere on your Ubuntu 20.04 machine. Time to start using it – enjoy the power of a clean, native build!