How to Install and Uninstall gcc-9 Ubuntu 22.04

Updated: October 20, 2022

This is the GNU C compiler, a fairly portable optimizing compiler for C. In this guide, I will show you ways to install gcc-9 Ubuntu 22.04.


  • Operating system: Ubuntu 22.04 or older versions with more than 2GB RAM
  • Privileges: Ensure that you are able to execute the sudo commands line.

Prerequisites to install gcc-9 on Ubuntu 22.04

Install gcc-9 Ubuntu 22.04

gcc-9 is one of the popular ways on Ubuntu now so that this tutorial will show you some ways to install it. Choose the one you believe is simple and easy to follow.

Install gcc-9 using APT

This is a popular method for installing Ubuntu packages since it’s simple to understand, even if you’re new to Linux. Following these steps to install gcc-9 on your Ubuntu 22.04.

Step 1: Update the APT database to fetch new packages from Ubuntu. Launching the terminal and entering the following Linux command:

sudo apt-get update

Step 2: Start the package installation on Ubuntu 22.04. After updating, you can install gcc-9 Ubuntu by pasting this command into the terminal and executing it.

sudo apt install gcc-9

Install gcc-9 using Aptitude

Aptitude allows users to view a list of available packages and manage package installation, upgrade, and removal. If you haven’t already installed it on Ubuntu, run this command to do so.

sudo apt -y install aptitude

After that, you can now install gcc-9, just following these steps:

Step 1: The APT package repository cache needs to be updated before you try to install, update, or remove any packages. Obtain new packages from Ubuntu by updating the APT database. Launch the terminal and enter the following Linux command:

sudo apt update

Step 2: Start installing the packages on Ubuntu 22.04. You can now install gcc-9 Ubuntu by executing this command in the terminal.

sudo aptitude -y install gcc-9

Uninstall gcc-9 on Ubuntu 22.04

Have you ever thought about how difficult it is to uninstall an application from Ubuntu? You are mistaken; anyone can easily uninstall any program, not just a package.

If you installed gcc-9 using APT or Aptitude, you could uninstall gcc-9 on Ubuntu by following this step:

sudo apt remove --auto-remove gcc-9

If you want to uninstall gcc-9 and remove its data and dependencies, you can also run the following command:

sudo apt autoremove --purge gcc-9


In this guide, I showed you ways to install gcc-9 on Ubuntu 22.04 and ways to uninstall gcc-9 too. Please do not hesitate to contact me if you require any assistance. I’m delighted to respond to them.