How to uninstall C++ on Linux

Hello, Coders! In this C++ tutorial, we will discuss the steps to uninstall the C++ setup from a Linux system. Before dive into the main topic, let’s briefly discuss what does it mean to uninstall the C++ from a system.

To run a C++ program in a Linux distro like Ubuntu, Red Hat, Fedora, Arch Linux, etc we need the GCC the GNU C++, and C compiler in our System.

By configuring different types of IDE with the C++ compiler, we can easily run any C++ program easily. Uninstalling this C++ setup is as easy as the installation process, which can be done by using the command line interface of the Linux system.

Uninstalling C++ in various Linux Distros

Uninstall C++ Debian Based Linux Distro

To uninstall C++ in Debian-based Linux distributions like Linux Mint, Ubuntu, Kali Linux, Parrot OS we will use the apt-get command-line tool.

Step1: Check whether the gcc compiler is available in your system or not by using which command.

codespeedy@ubuntu:~$ which gcc

Output:

/usr/bin/gcc

Step2: Remove gcc from the system using apt-get.

codespeedy@ubuntu:~$ sudo apt-get remove gcc

output:

How to uninstall C++ on Linux

 Alternative: Remove the dependencies and gcc configuration also by the following command.

codespeedy@ubuntu:~$ sudo apt-get purge gcc

output:

Remove the dependencies and gcc configuration

Uninstall C++ Arch Linux Based Linux Distro

To uninstall C++ in Arch Linux-based Linux distributions like Manjaro, Garuda Linux we will use the pacman command-line tool.

Step1: Check whether the gcc compiler is available in your system or not by using which command.

codespeedy@ubuntu:~$ which gcc

Output:

/usr/bin/gcc

Step2: Remove the gcc from the system using pacman.

codespeedy@ubuntu:~$ sudo pacman -R gcc

output:

uninstall C++ in Arch Linux-based Linux distributions

Alternative: Remove the dependencies and gcc configuration also by the following command.

codespeedy@ubuntu:~$ sudo pacman -Rsc gcc

output:

uninstall C++ in Arch Linux-based Linux distributions

Fedora Based Linux Distro

To uninstall C++ in Fedora-based Linux distributions like Fedora spins, Ubuntu, Qubes OS, ClearOS we will use the dnf/rpm command-line tool.

Step1: Check whether the gcc compiler is available in your system or not by using which command.

codespeedy@ubuntu:~$ which gcc

Output:

/usr/bin/gcc

Step2: Remove gcc from the system using dnf.

codespeedy@ubuntu:~$ sudo dnf remove gcc

Output:

uninstall C++ in Fedora-based Linux distributions like Fedora spins, Ubuntu

Hope this tutorial has helped you to understand how we can remove or uninstall C++ from a Linux system.

Happy Coding!!

You can also read, Find MAC address of Linux Device in C++

Leave a Reply

Your email address will not be published. Required fields are marked *