Mona phys
Mona phys

Reputation: 111

Uninstalling gcc

I want to uninstall my gcc by terminal. When I type

gcc --version

The output is

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Could anyone help me? How can I install the last version of gcc after that?

Upvotes: 6

Views: 40700

Answers (1)

Lakshmikant Deshpande
Lakshmikant Deshpande

Reputation: 844

Use the following command (Replace <version> with the appropriate version):

sudo apt-get --purge remove gcc-<version>

You can install a specific version of a program using apt, you can use the following command. (Replace <version> with the appropriate version)

sudo apt-get install gcc=<version>

Alternatively, you can use Synaptic Package Manager.

sudo apt-get update
sudo apt-get install synaptic

Note that, you might need GCC for some programs. If you face any driver issues while installing programs / drivers you can install the latest GCC by using:

sudo apt-get install gcc

Upvotes: 6

Related Questions