# How to install latest version of GNU?

**URL:** <https://discuss.circleci.com/t/how-to-install-latest-version-of-gnu/51779>\
**Category:** Build Environment\
**Tags:** gcc, cpp\
**Created:** [August 26, 2024, 5:12am UTC](https://discuss.circleci.com/t/how-to-install-latest-version-of-gnu/51779 "2024-08-26T05:12:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apostolu](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@apostolu](https://discuss.circleci.com/u/apostolu)\
**Post date:** [August 26, 2024, 5:12am UTC](https://discuss.circleci.com/t/how-to-install-latest-version-of-gnu/51779/1 "2024-08-26T05:12:17Z")

</div>

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?

```auto
sudo apt update
sudo apt upgrade
sudo apt install gcc

```

```auto
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0

```

Thanks!

---

<div class="post-metadata">

**Author:** ![apostolu](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@apostolu](https://discuss.circleci.com/u/apostolu)\
**Post date:** [August 26, 2024, 8:01pm UTC](https://discuss.circleci.com/t/how-to-install-latest-version-of-gnu/51779/3 "2024-08-26T20:01:28Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![wyardley](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/wyardley/32/19231_2.png) [@wyardley](https://discuss.circleci.com/u/wyardley)\
**Post date:** [August 27, 2024, 3:22am UTC](https://discuss.circleci.com/t/how-to-install-latest-version-of-gnu/51779/4 "2024-08-27T03:22:44Z")

</div>

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:

```auto
% 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.

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [September 3, 2024, 3:23am UTC](https://discuss.circleci.com/t/how-to-install-latest-version-of-gnu/51779/5 "2024-09-03T03:23:24Z")

</div>

Closed on September 3, 2024, 3:23am UTC

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