How to install latest version of GNU?

,

How would I install the latest version of GNU? I am using image: cimg/base:stable for my Docker in each of my jobs.

When I try the following, command, it only install C and CXX compiler versions 9.4.0, but I need minimum version 11 to support some C++ features I’m using in my code. How can I achieve this?

sudo apt update
sudo apt upgrade
sudo apt install gcc
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0

Thanks!

I have found the solution to be installing it from a PPA, such as the Ubuntu Toolchain PPA

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

You could consider using another image as well; if you want to stay within the CircleCI image family, you could use the edge-22.04 tag, for example:

% docker run -it cimg/base:edge-22.04 gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 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.
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.