When building Linux kernels for ARM or RISC-V embedded boards (Raspberry Pi, BeagleBone, Yocto builds), running dtc to compile Device Tree Source (.dts) files into Device Tree Blobs (.dtb) can fail with bash: dtc: command not found. Installing device-tree-compiler resolves the error.

Installation & Device Tree Compilation Commands

Terminal Installation & DTC Commandsbash
# Install Device Tree Compiler package on Ubuntu/Debian
sudo apt update
sudo apt install -y device-tree-compiler
 
# Compile Device Tree Source (.dts) into binary Device Tree Blob (.dtb)
dtc -I dts -O dtb -o am335x-boneblack.dtb am335x-boneblack.dts
 
# Decompile binary blob (.dtb) back to human-readable source (.dts)
dtc -I dtb -O dts -o decompiled.dts system.dtb