How to Install GCC on Debian 13 (Trixie)
GCC (GNU Compiler Collection) is the standard compiler for C, C++, and other programming languages on Linux systems.
This guide shows how to install GCC and essential build tools on Debian 13.
Update the System
apt update && apt upgrade -y
Install GCC and Build Essentials
Install the compiler and commonly used tools for building software:
apt install -y build-essential
This includes:
gcc— GNU C Compilerg++— GNU C++ Compilermake— Build toollibc6-dev— C standard library headers
Verify GCC Installation
Check GCC version:
gcc --version
Output:
root@server:~# gcc --version
gcc (Debian 14.2.0-19) 14.2.0
Check G++ version:
g++ --version
Output:
root@server:~# g++ --version
g++ (Debian 14.2.0-19) 14.2.0
Test GCC Compiler
Create a test C program:
nano hello.c
Paste:
#include <stdio.h>
int main() {
printf("Hello, Debian 13!\n");
return 0;
}
Compile it:
gcc hello.c -o hello
Run the program:
./hello
Output:
Hello, Debian 13!
Conclusion
You now have the GCC compiler and required build tools installed on Debian 13. You can compile and run C/C++ or other source code directly on your system.
References
- GCC Official Site: https://gcc.gnu.org
- Debian Developer Tools: https://wiki.debian.org/BuildingTutorial
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS