How To Install gcc-snapshot on Ubuntu 18.04

In this tutorial we learn how to install gcc-snapshot on Ubuntu 18.04. gcc-snapshot is SNAPSHOT of the GNU Compiler Collection

Introduction

In this tutorial we learn how to install gcc-snapshot on Ubuntu 18.04.

What is gcc-snapshot

gcc-snapshot is:

This package contains a recent development SNAPSHOT of all files contained in the GNU Compiler Collection (GCC).

The source code for this package has been exported from SVN trunk.

DO NOT USE THIS SNAPSHOT FOR BUILDING DEBIAN PACKAGES!

This package will NEVER hit the testing distribution. It is used for tracking gcc bugs submitted to the Debian BTS in recent development versions of gcc.

There are three methods to install gcc-snapshot on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install gcc-snapshot Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install gcc-snapshot using apt-get by running the following command:

sudo apt-get -y install gcc-snapshot

Install gcc-snapshot Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install gcc-snapshot using apt by running the following command:

sudo apt -y install gcc-snapshot

Install gcc-snapshot Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install gcc-snapshot using aptitude by running the following command:

sudo aptitude -y install gcc-snapshot

How To Uninstall gcc-snapshot on Ubuntu 18.04

To uninstall only the gcc-snapshot package we can use the following command:

sudo apt-get remove gcc-snapshot

Uninstall gcc-snapshot And Its Dependencies

To uninstall gcc-snapshot and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove gcc-snapshot

Remove gcc-snapshot Configurations and Data

To remove gcc-snapshot configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge gcc-snapshot

Remove gcc-snapshot configuration, data, and all of its dependencies

We can use the following command to remove gcc-snapshot configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge gcc-snapshot

References

Summary

In this tutorial we learn how to install gcc-snapshot package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.