How to install GCC 11 on Ubuntu

GCC can be used to compile C, C++, Objective C and Objective C++ languages.

GCC 11 is the current Developer Tools Module compiler in SUSE Linux Enterprise 15 SP3.

It targets essential optimization levels and LTO and PGO options.

In this tutorial you will learn how to install GCC 11 on Ubuntu, test it and uninstall it.

  • How to install GCC 11 on Ubuntu
  • How to test GCC 11 on Ubuntu
  • How to Uninstall GCC 11 on Ubuntu

How to install GCC 11 on Ubuntu

To install GCC 11 on Ubuntu, you need to add the Toolchain repository and install GCC 11 by running this command, “sudo apt install -y gcc-11”.

Step 1: Add Toolchain repository

sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test

Step 2: Install GCC 11 on Ubuntu

sudo apt install -y gcc-11

Step 3: Verify GCC 11 . Version

gcc-11 –version

How to test GCC 11 on Ubuntu

To test GCC 11 on Ubuntu, you need to create a main.c file, copy and paste the example code, compile the code and run the program.

1. Create file main.c

main nano.c

2. Copy and paste this code

int main() { printf(“Hello\n”); returns 0; }

3. Compile the code

gcc-11 main.c -o check

4. Run the program

./Test

How to Uninstall GCC 11 on Ubuntu

To uninstall GCC 11 on Ubuntu you need to remove GCC 11 and related dependencies, and also remove the GCC repository and key by running some commands.

See more:  45+ Free Freepik Premium Accounts

1. Remove GCC 11/related dependencies

sudo apt purge –autoremove -y gcc-11

2. Delete GCC repository + key

sudo rm -rf /etc/apt/trusted.gpg.d/ubuntu-toolchain-r_ubuntu_test.gpg sudo rm -rf /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-focal.list

read more

How to install jq on Ubuntu

What is LD_LIBRARY_PATH?

How to fix “python: cannot open file ‘manage.py’: [Errno 2] No file or directory”

Categories: How to
Source: thpttranhungdao.edu.vn/en/

Rate this post

Leave a Comment