The objective is to install GCC the C compiler on Ubuntu 18.04 Bionic Beaver
Operating System and Software Versions
- Operating System: - Ubuntu 18.04 Bionic Beaver
Privileged access to your Ubuntu System as root or via
command is required.
- # - requires given linux commands to be executed with root privileges either directly as a root user or by use of
- $ - requires given linux commands to be executed as a regular non-privileged user
Other Versions of this Tutorial
Ubuntu 20.04 (Focal Fossa)
The following linux command
compiler on on Ubuntu 18.04 Bionic Beaver. Open up terminal
$ sudo apt install gcc
SUBSCRIBE TO NEWSLETTER
Subscribe to Linux Career NEWSLETTER and receive latest Linux news, jobs, career advice and tutorials.
Another way to install
compiler is to install it as part of
package will also install additional libraries as well as
compiler. In most cases or if unsure this is exactly what you need:
$ sudo apt install build-essential
Check GCC version
Confirm your installation by checking for GCC version:
$ gcc --version
gcc (Ubuntu 7.2.0-18ubuntu2) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
C Hello World
Compile a simple C "Hello World" code:
Save the above code within
file, compile and execute it:
$ gcc -o hello hello.c