If you have been following my previous posts, then you've probably realized how much I love using the command line to manage and maintain our Ubuntu server. Today, we will be installing the GNU C Compiler (GCC) on your Ubuntu server using the sudo apt-get command.
In this tutorial, we will be using a package manager called apt-get, which is also known as Software & Updates Manager or Software Update. You can find more information about how to use apt-get and other package managers by going to our previous post on it: 10 command line tools for Ubuntu administrators.
To get started with this tutorial, we will create a new directory and install GCC there.
Let's start by creating the directory where we want to install GCC:
```bash
mkdir gcc
cd gcc
```
Next, let's add the package manager to your system so that you can easily install, upgrade or remove packages using apt-get:
```bash
sudo apt-get install sudo apt-utils
```
You will need to accept the license agreement if prompted. If not, press Enter.
Now, let's install GCC using the command:
```bash
sudo apt-get update && sudo apt-get install gcc
```
If you want to upgrade all packages, use this command:
```bash
sudo apt-get update && sudo apt-get upgrade
```
That's it! GCC is now installed on your system. We can verify that we have the package by running the following command:
```bash
sudo apt-get list gcc | grep gcc-doc
```
This will return a list of all packages installed along with their documentation. For this tutorial, we have successfully installed GCC. Now, let's move on to installing some useful utilities that you can use for administrative tasks like managing repositories and setting up your server.
For more information about these utilities, please refer to our previous post: How to manage Ubuntu servers using apt-get, pacman & aptitude. If you have any issues or want assistance, feel free to ask. Enjoy!