How to build KiCad on Ubuntu in 10 minutes

This sequence of commands can be used to quickly compile KiCad on Ubuntu

Add repository so we can install the build dependencies

sudo add-apt-repository --enable-source --yes ppa:kicad/kicad-8.0-releases
sudo apt update

Install build dependencies

sudo apt build-dep kicad
# Install other build tools
apt -y install ninja-build mold libprotobuf-dev protobuf-compiler python3-pip
# Install Python dependencies
pip install --user --break-system-packages wxpython

Clone the KiCad source code

git clone https://gitlab.com/kicad/code/kicad.git

Optionally, you can checkout a specific branch, but most users will want to build master, which is checked out by default.

Building KiCad using ninja

mkdir -p build/release
cd build/release
cmake -G Ninja -DCMAKE_BUILD_TYPE=ReleaseWithDebInfo -DCMAKE_CXX_FLAGS=-fuse-ld=mold ../../
ninja -j8