How to Install GCC on Ubuntu 25.10

GCC (GNU Compiler Collection) is a key development toolchain capable of compiling C, C++, Fortran, and other programming languages. It handles compilation, linking, and preparation of binary executables or libraries.

Ubuntu 25.10 "Questing Quokka" supports many versions of GCC — version 11 through 15 are available, and GCC 15 is included in the archive.

Here’s how to install the latest supported version of GCC on Ubuntu 25.10.

Update System

First, refresh your package index and upgrade packages:

sudo apt update
sudo apt upgrade -y

Install GCC (Latest Version Available)

Install build-essential which pulls in GCC, G++, make, and other tools:

sudo apt install build-essential

Optionally install specific version (for example GCC 15) if you want the very newest major version:

sudo apt install gcc-15 g++-15

Verify GCC Version

To check which version of gcc is active:

gcc --version

Output:

gcc (Ubuntu 15.2.0-4ubuntu2) 15.2.0

Compiling a Hello World Example

Create a simple C program named hello.c:

nano hello.c

Add:

#include <stdio.h>

int main() {
    printf("Hello, world!\n");
    return 0;
}

Compile it:

gcc -o hello hello.c

Run it:

./hello

Output:

Hello, world!

Conclusion

You have successfully installed a modern GCC toolchain on Ubuntu 25.10.
You are now ready to compile C/C++ programs, use newer language standards, and build software on your system.


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