Build ccache 4.11.3 from Source on Ubuntu 24.04

Goal: Compile and install ccache v4.11.3 from source on Ubuntu 24.04, with manpages. Includes expected install output, sanity checks, and clean uninstall.


Prerequisites

sudo apt update
sudo apt install -y git cmake build-essential asciidoctor
  • build-essential → gcc/g++/make
  • asciidoctor → builds manpages (optional; skip if you don’t need docs)

Build & Install (from source)

# 1) Fetch source
git clone https://github.com/ccache/ccache.git
cd ccache
git checkout v4.11.3

# 2) Configure & compile
mkdir build && cd build
cmake -D CMAKE_BUILD_TYPE=Release ..
make -j"$(nproc)"

# 3) Install
sudo make install

Default install locations

  • Binary: /usr/local/bin/ccache
  • Man page: /usr/local/share/man/man1/ccache.1

Expected install output (example)

[ 76%] Built target doc-man-page
[ 78%] Built target doc-html
[100%] Built target unittest
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/share/man/man1/ccache.1
-- Installing: /usr/local/bin/ccache

Sanity check

which ccache
ccache --version
ccache -s
man cccach

Uninstall

cd ~/ccache/build
sudo make uninstall

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top