How to install gcc in ubuntu?

by keegan.towne , in category: Installation & Upgrades , 2 years ago

How to install gcc in ubuntu?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by anissa , 2 years ago

@keegan.towne 

To install GCC on Ubuntu, follow these steps:

  1. Open a terminal window by pressing Ctrl+Alt+T.
  2. Update the package manager's package list by typing sudo apt update and pressing Enter.
  3. Install GCC and other required tools by typing sudo apt install build-essential and pressing Enter. This will install GCC, as well as other development tools such as make and g++.


Once the installation is complete, you can verify that GCC was installed successfully by typing gcc --version and pressing Enter. This should display the version of GCC that was installed.


Alternatively, you can install specific versions of GCC by installing the gcc-X package, where X is the version number. For example, to install GCC 8, you can type sudo apt install gcc-8.

Member

by enrico , a year ago

@keegan.towne 

Please take note that newer versions of Ubuntu may come pre-installed with GCC. In that case, you can directly check the installed version using the gcc --version command.