forked from rudenkornk/cpp_image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_gcc.sh
executable file
·36 lines (28 loc) · 1.19 KB
/
install_gcc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
set -o xtrace
GCC_VERSION=12
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
gpg-agent \
software-properties-common \
add-apt-repository ppa:ubuntu-toolchain-r/test --yes
DEBIAN_FRONTEND=noninteractive apt-get install --yes --no-install-recommends \
gcc-$GCC_VERSION \
g++-$GCC_VERSION \
rm -rf /var/lib/apt/lists/*
update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-$GCC_VERSION $GCC_VERSION"0" \
--slave /usr/bin/cc cc /usr/bin/gcc-$GCC_VERSION \
--slave /usr/bin/g++ g++ /usr/bin/g++-$GCC_VERSION \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-$GCC_VERSION \
--slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-$GCC_VERSION \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-$GCC_VERSION \
--slave /usr/bin/gcov gcov /usr/bin/gcov-$GCC_VERSION \
--slave /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-$GCC_VERSION \
--slave /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-$GCC_VERSION \
--slave /usr/bin/lto-dump lto-dump /usr/bin/lto-dump-$GCC_VERSION \
update-alternatives \
--install /usr/bin/cpp cpp /usr/bin/cpp-$GCC_VERSION $GCC_VERSION"0" \