Update using terminal:
Run the command prompt/terminal (
cmdorsh).Update the package list:
mingw-get updateAfter 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
When the GUI is open, tap
Installation -> Update Catalogue. This will update the package list.After that, tap
Installation -> Mark All Upgrades. This will select all of the packages which can be upgraded.Finally, tap
Installation -> Apply Changesto apply the upgrades.
Videos
Update using terminal:
Run the command prompt/terminal (
cmdorsh).Update the package list:
mingw-get updateAfter 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
When the GUI is open, tap
Installation -> Update Catalogue. This will update the package list.After that, tap
Installation -> Mark All Upgrades. This will select all of the packages which can be upgraded.Finally, tap
Installation -> Apply Changesto apply the upgrades.
Snapshots and release builds of the MinGW http://code.google.com/p/mingw-builds/downloads/list
You can install GCC 6 by adding the ubuntu-toolchain-r/test PPA. To do so, run the following commands:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-6
You can verify that gcc-6 is installed by running gcc-6 --version and the output should say gcc-6 (Ubuntu 6.1.1-2ubuntu12~16.04) 6.1.1 20160510.
As suggested by Mohamed Slama, if you want to further change the default GCC and G++ to the latest versions, install g++-6 with
sudo apt install g++-6
and then run
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
If you want to build it from source (which I recommend as you can for example make a cross-compiler, etc.) download the source from a mirror.
Then extract it with:
tar -xvf gcc-6.1.0.tar.gz
After that change directory to there:
cd gcc-6.1.0
Then create build directory and cd to it:
mkdir build
cd build
Then configure the makefile (--disable-multilib means to not build libraries for cross-compilation):
../configure --enable-languages=c,c++ --disable-multilib
If you ran into errors due to missing required libraries or other prerequisites: (Credits to this)
./contrib/download_prerequisites
And then build it:
make -j 8
This process may take some time and after done invoke this:
sudo make install
That's it!
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
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 executeexittwice to exit the opened shell window, which verifies that thesclcommand 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~/.bashrcprofile, 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.