Ways to Install and Uninstall c++-compiler on Ubuntu 22.04

Updated: October 30, 2022

This is a virtual package. See the Debian policy for a definition of virtual packages. In this guide, I will show you ways to install c++-compiler Ubuntu 22.04.

Requirements to install

  • Operating system: c++-compiler needs Ubuntu 22.04 to work
  • Privileges: Verify that you can execute the sudo commands line.

Prerequisites to install c++-compiler on Ubuntu 22.04

Install c++-compiler Ubuntu 22.04

c++-compiler 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 c++-compiler 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 instructions to install c++-compiler on your Ubuntu.

Step 1: You must update the APT package repository cache before attempting to install, update, or remove any packages. Update the APT database to download new packages from Ubuntu. Launching the terminal and entering the following Linux command:

sudo apt -y update

Step 2: Install the package on Ubuntu 22.04. After updating the system, you can install c++-compiler Ubuntu by pasting this command into the terminal and executing it.

sudo apt -y install c++-compiler

Install c++-compiler using Aptitude

If you haven’t already installed Aptitude on Ubuntu, run this command to do so.

sudo apt -y install aptitude

Then, you can now install c++-compiler by 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. Opening the terminal and executing the following Linux command:

sudo apt -y update

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

sudo aptitude -y install c++-compiler

Uninstall c++-compiler on Ubuntu 22.04

Have you ever thought that uninstalling an application from Ubuntu might be challenging? You’re wrong; any program, not just a c++-compiler, can be easily uninstalled by anyone.

If you installed c++-compiler using APT or Aptitude, you could uninstall c++-compiler on Ubuntu by following this step:

sudo apt remove --auto-remove c++-compiler

You can also execute this command if you want to uninstall c++-compiler and remove its data and dependencies:

sudo apt autoremove --purge c++-compiler


In this guide, I showed you ways to install c++-compiler on Ubuntu 22.04 and ways to uninstall c++-compiler too. Please contact me if you require any assistance. I’d be delighted to respond.