Update using terminal:

  1. Run the command prompt/terminal (cmd or sh).

  2. Update the package list:

    mingw-get update
    
  3. After updating the package list, run:

    mingw-get upgrade
    

When the command finishes running, all of your packages will be upgraded.


Update using the GUI version:

If you aren't used to the terminal, there is also a GUI version of MinGW called "MinGW Installation Manager", which is normally located at:

C:\MinGW\libexec\mingw-get\guimain.exe
  1. When the GUI is open, tap Installation -> Update Catalogue. This will update the package list.

  2. After that, tap Installation -> Mark All Upgrades. This will select all of the packages which can be upgraded.

  3. Finally, tap Installation -> Apply Changes to apply the upgrades.

Answer from Yuriy Petrovskiy on Stack Overflow
🌐
GNU
gcc.gnu.org › gcc-15
GCC 15 Release Series - GNU Project
This release is a bug-fix release, containing fixes for regressions in GCC 15.1 relative to previous releases of GCC.
Installing GCC
The latest version of this document is always available at https://gcc.gnu.org/install/. It refers to the current development sources, instructions for specific released versions are included with the sources.
GCC mirror sites
Our releases are available on the GNU download server and its mirrors. In addition the following sites mirror gcc.gnu.org (Phoenix, Arizona, USA) directly, and should also carry our snapshots:
GCC Releases
GCC releases may be downloaded from our mirror sites.
Downloading GCC
The source distribution includes ... (GCC 13 and later) and Algol 68 (GCC 16 and later, experimental) compilers, as well as runtime libraries for C++, Objective-C, COBOL, Fortran and Algol 68. For previous versions these were downloadable as separate components such as the core ...
🌐
GNU
gcc.gnu.org › releases.html
GCC Releases - GNU Project
GCC releases may be downloaded from our mirror sites.
🌐
GNU
gcc.gnu.org › install
Installing GCC - GNU Project
The latest version of this document is always available at https://gcc.gnu.org/install/. It refers to the current development sources, instructions for specific released versions are included with the sources.
🌐
GNU
gcc.gnu.org › install › download.html
Downloading GCC - GNU Project
Likewise the GMP, MPFR, MPC and Gettext libraries can be automatically built together with GCC. You may simply run the contrib/download_prerequisites script in the GCC source directory to set up everything.
🌐
Linux Mint Forums
forums.linuxmint.com › board index › interests › programming & development
How to Update GCC Latest Version? - Linux Mint Forums
gcc-11 --version gcc-11 (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions.
🌐
Google Groups
groups.google.com › g › ns-3-users › c › 5o1MgnAcYAI
gcc update or upgrade
gcc version 4.8.5 older than minimum supported version 4.9.2 (complete log in /home/Omar/ns-allinone-3.33/ns-3.33/build/config.log)
Find elsewhere
🌐
Baeldung
baeldung.com › home › installation › how to install the latest version of gcc on ubuntu
How to Install the Latest Version of GCC on Ubuntu | Baeldung on Linux
November 17, 2024 - As usual, we first update the package list on the machine: ... At this point, we should be ready to build GCC. To begin with, let’s utilize the wget command to download the source code as a .tar archive from the official GCC website:
Top answer
1 of 1
18

This is a common pattern in linux. When there are multiple versions of the same program installed, though the executables are all present in the /usr/bin/ directory, only one of them is "visible" as that program. For example, if you install gcc-9 and gcc-10, both executables are present as /usr/bin/gcc-9 and /usr/bin/gcc-10 but only one of them is visible as gcc. This happens by symlinking a preferred version to the same directory as /usr/bin/gcc. In ubuntu 20.04, the preferred version is gcc-9 and so, gcc-9 is symlinked as gcc.

You can check this by running the following command.

$ which gcc | xargs file

The output will be

/usr/bin/gcc: symbolic link to gcc-9

There are a few things you can do to use gcc-10 as your c compiler.

  1. Directly call the gcc-10 executable. Instead of using gcc <code.c>, call gcc-10 <code.c>.
  2. You can manually symlink gcc-10 as the preferred gcc. Assuming you did not modify the system paths, the following command can be used.
# ln -s /usr/bin/gcc-10 /usr/local/bin/gcc

This works because, by default, the executables in /usr/local/bin/ take precedence over /usr/bin/.

  1. If you are using bash, you can create an alias for gcc as gcc-10. Add the following line to your .bashrc.
alias gcc="gcc-10"

Remember to relaunch bash or source ~/.bashrc.

  1. Using update-alternatives (Thanks to @ted-lyngmo for pointing it out). Debian based distributions supply a separate program, that can make symlinking easier / more functional. Read more using man update-alternatives. To use gcc-10 as the preferred gcc, use the following command.
# update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60

The above command says, /usr/bin/gcc is the link needed and the name is gcc, the target executable is /usr/bin/gcc-10 and it has a priority of 60.

This links gcc to /etc/alternatives/gcc, which itself is a symlink to /usr/bin/gcc-10. If a higher priority program is added to update-alternatives, /etc/alternatives/gcc points to the higher priority program.

If you don't have any specific reason, I would also recommend to upgrade to a newer ubuntu version, so that the default gcc is a newer one.

I read on the gcc website that version 9.4 is more up-to-date than some 10.x versions.

With newer gcc versions, new features are added. Support for newer c/c++ standards are also added. Eg. You can read the changes for gcc-10 here. But people still need gcc-9 because some programs only build with gcc-9. So, GNU maintains gcc-9 (and much older versions) for a long time. Bugs are fixed, and newer releases are made. This can happen after the release of a newer gcc version. So, it is very much possible that a version of gcc-9 is newer than a version of gcc-10.

🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to install gcc compiler on ubuntu
How to Install GCC Compiler on Ubuntu {3 Simple Methods}
February 20, 2025 - 2. Install the libgmp3-dev, libmpfr-dev, and libmpc-dev packages to facilitate compiling GCC from source: sudo apt install libmpfr-dev libgmp3-dev libmpc-dev -y · 3. Use the wget command to download the GCC source code from the GCC website.
Top answer
1 of 2
16

I've confirmed that you can upgrade gcc from the default version 4.8 on centOS 7.

First, we need to install "Software Collections" in order to access some of the community packages including gcc v7

  • sudo yum install -y centos-release-scl

Next, we want to install a developer toolset. Depending on your needs, you may want a different devtoolset. Here I'm targeting 7:

  • sudo yum install -y devtoolset-7

Finally, you'll want to change over to gcc 7 as your default, launch a new shell session with the scl tool:

  • scl enable devtoolset-7 bash
2 of 2
1

Enable the software collection in the answer is only effective in the current shell. The scl utility will create a "child-shell" that set the PATH variables properly, so that in the new child-shell, the enabled software collections will be firstly searched. These settings obviously only take effective temporarily in the current shell.

To make it permanently effective, add the command, source /opt/rh/devtoolset-7/enable to the user's profile (~/.bash_profile or ~/.bashrc for RHEL based OS, like CentOS 7). Then, start a new shell and you will have the right tools available.

After execute scl enable devtoolset-7 bash, you will need to execute exit twice to exit the opened shell window, which verifies that the scl command created a new shell instance as a child process. There might be side-effect with creating a child-shell, so do not put this command in the ~/.bashrc profile, otherwise it will repeatedly create child-shell (non-login shell) as each shell will load the profile, resulting in a endless recursive loop. Put it in ~/.bash_profile, it will be loaded for only once (for the login shell), but you will need to exit twice every time.

But for development purpose, scl enable devtoolset-7 bash would be preferred, as you can exit the created child-shell, and then switch between different versions of the same software.


More details about the GCC version in python terminal:

The version info of the built-in Python in CentOS 7:

[root@conda condabuilder]# python
Python 2.7.5 (default, Nov 16 2020, 22:23:17) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

The version info of the user installed (via conda) Python on a system even without higher version of GCC installed:

[root@conda condabuilder]# conda activate jupyter
(jupyter) [root@conda condabuilder]# python -VV
Python 3.10.9 | packaged by conda-forge | (main, Feb  2 2023, 20:20:04) [GCC 11.3.0]

From the results, we can see that the GCC version contained in Python's version info is not related to the system's GCC. The system's default Python (2.7.5) should have been compiled with the GCC version distributed with CentOS 7, so the version info show the same GCC version. But for user installed python, the GCC version info actually depends on what version of GCC is used for building and packging the python binary.

🌐
Preshing
preshing.com › 20141108 › how-to-install-the-latest-gcc-on-windows
How to Install the Latest GCC on Windows
C:\cygwin64>setup-x86_64.exe -q -P wget -P gcc-g++ -P make -P diffutils -P libmpfr-devel -P libgmp-devel -P libmpc-devel · A window will pop up and download all the required packages along with their dependencies.
🌐
CyberITHub
cyberithub.com › how-to-update-or-upgrade-gcc-to-latest-version-on-ubuntu-debian
How to Update or Upgrade GCC to Latest Version on Ubuntu/Debian | CyberITHub
August 13, 2023 - Now you can install the latest version of gcc, that is gcc-11(this is the latest version available at the time of writing this article) using sudo apt install gcc-11 command as shown below.
🌐
Medium
medium.com › @xersendo › moving-to-c-26-how-to-build-and-set-up-gcc-15-1-on-ubuntu-f52cc9173fa0
Moving to C++26: How to Build and Set Up GCC 15.1 on Ubuntu
May 3, 2025 - That’s because we still need to tell the system to use our shiny new GCC by default. sudo update-alternatives --install /usr/bin/gcc gcc /opt/gcc-15/bin/gcc 100 sudo update-alternatives --install /usr/bin/g++ g++ /opt/gcc-15/bin/g++ 100
🌐
GitHub
gist.github.com › alptugan › fd0a4fce9aa423eb1d62806c94677ca7
update gcc version · GitHub
Download ZIP · Raw · update gcc version · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters ·
🌐
GitHub
gist.github.com › application2000 › 73fd6f4bf1be6600a2cf9f56315a2d91
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04) · GitHub
sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get install build-essential software-properties-common -y && sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt-get update -y && sudo ...
🌐
GNU
gcc.gnu.org
GCC, the GNU Compiler Collection - GNU Project
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Objective-C++, Fortran, Ada, Go, D, Modula-2, COBOL, Rust, and Algol 68 as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system.