본문 바로가기
기술관련 기록

ubuntu16.04 g++6 설치

by 저녁추천좀 2020. 6. 12.
  • g++6 설치

    sudo add-apt-repository ppa:ubuntu-toolchain-r/test
    sudo apt-get update
    sudo apt-get install gcc-6
    sudo apt-get install g++-6
  • 기존 g++ 확인

➜  workspace ls -la /usr/bin/g++
lrwxrwxrwx 1 root root 5  3월  2 14:01 /usr/bin/g++ -> g++-5

➜  workspace g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Copyright (C) 2015 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.
  • g++-6 연결
➜  workspace sudo rm /usr/bin/g++
➜  workspace sudo ln /usr/bin/g++-6 /usr/bin/g++
  • 변경 확인
➜  workspace ls -la /usr/bin/g++
lrwxrwxrwx 2 root root 22 11월 13  2018 /usr/bin/g++ -> x86_64-linux-gnu-g++-6
➜  workspace g++ --version
g++ (Ubuntu 6.5.0-2ubuntu1~16.04) 6.5.0 20181026
Copyright (C) 2017 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.