Skip to content

Ubuntu Prerequisites

krisjanisp edited this page Oct 6, 2026 · 1 revision

Ubuntu prerequisites

Needed For Notes
Rust 1.89+ (rustc, cargo) build Edition 2024 needs 1.85, and current dependencies need 1.89. Ubuntu's default rustc package is too old.
C compiler (gcc, libc6-dev) build Needed by ring. make, pkg-config and OpenSSL headers are not needed.
openssl command scripts/*.sh, PSK generation CLI only, not the library.
curl, python3 quickstart commands
Python 3.11+ tests/*.py Uses tomllib. Ubuntu 22.04 has 3.10, so run only the Rust tests there.

Ubuntu 24.04 (also available on 22.04), minimal install from the distribution:

sudo apt-get update
sudo apt-get install -y --no-install-recommends \
    ca-certificates gcc libc6-dev curl openssl python3 rustc-1.91 cargo-1.91
export PATH=/usr/lib/rust-1.91/bin:$PATH   # add to ~/.profile to keep it

Any Ubuntu version can instead use rustup for Rust, after installing the other packages above without rustc-1.91 cargo-1.91:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal
. ~/.cargo/env

scripts/check-ubuntu.sh [IMAGE] (default ubuntu:24.04, requires Docker and network) installs exactly the apt packages above on a fresh container, then builds, runs the README quickstart, the Rust tests and all three Python tests. It takes about 90 seconds and passes on Ubuntu 24.04.

Ubuntu 22.04 was checked only for the rustup build and certificate generation, since its Python 3.10 cannot run the Python tests. The build was also confirmed with rustc-1.89, and fails with 1.85.

cargo fmt and cargo clippy need rustfmt and clippy: rustup component add rustfmt clippy. Ubuntu 24.04 has no versioned clippy package, so use rustup for those.

Clone this wiki locally