To compile software from source on Debian you need a set of development tools: the GCC C and C++ compilers, make, the C library headers and the Debian packaging helpers. Debian bundles all of them into a single meta-package called build-essential. This guide shows how to install it on Debian 13 “Trixie” and Debian 12 “Bookworm”, check that it works, and add the extra tools most source builds ask for.
Prerequisites
- A system running Debian 13 or Debian 12 (desktop or server).
- A user with sudo privileges, or access to the root account.
Step 1 of 4Install build-essential
Refresh the package index, then install the meta-package:
sudo apt updatesudo apt install build-essential
build-essential pulls in these packages as dependencies:
| Package | What it provides |
|---|---|
| gcc | The GNU C compiler |
| g++ | The GNU C++ compiler |
| make | Runs the build steps defined in a Makefile |
| libc6-dev | Headers and libraries for the GNU C library |
| dpkg-dev | Tools for building Debian packages |
Step 2 of 4Verify the Installation
Check the versions of the compiler and make:
gcc --versiong++ --versionmake --version
Debian 13 ships GCC 14 and Debian 12 ships GCC 12, so the first line of gcc --version starts with gcc (Debian 14. on Debian 13 and gcc (Debian 12. on Debian 12. The rest of the version string changes with Debian point releases.
Step 3 of 4Compile a Test Program
Create a small C program to confirm that the toolchain works end to end:
printf '#include <stdio.h>nint main(void) { printf("Hello from GCC\n"); return 0; }n' > hello.cgcc hello.c -o hello./hello
If you see Hello from GCC, the compiler, linker and C library headers are all in place.
Step 4 of 4Install Common Extra Build Tools (Optional)
Many source packages use Autotools, CMake or pkg-config, and download code with Git. Install them together:
sudo apt install autoconf automake libtool pkg-config cmake git
If a project’s build fails with a message about a missing header such as openssl/ssl.h, install the matching -dev package, for example libssl-dev. To install every build dependency of a package that exists in Debian’s repositories, enable the deb-src entries in your APT sources and run sudo apt build-dep <package>.
Conclusion
One command, sudo apt install build-essential, gives a Debian 13 or Debian 12 system everything it needs to compile C and C++ software. Add CMake, Autotools and pkg-config when a project calls for them. New to Debian 13? Read what’s new in Debian 13 “Trixie”.
How did it make you feel?

Thank you for info!
Thanks! very handy!
Very useful, thanks!!