본문 바로가기
컴퓨터.IT/우분투(ubuntu)

우분투(Ubuntu) gcc 설치및 업데이트

by www.woobi.org 2018. 6. 4.

1.  설치된 버젼 확인 

$ gcc -v

 

2. 설치가 안되었다면 설치하기(g++도 같이 설치)

$ sudo apt-get install gcc

$ sudo apt-get install g++

 

3.업그레이드 하기

 

 3-1 저장소 추가

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

 

 3-2 저장소 업데이트

$ sudo apt-get update

 

 3-3 선택버전 설치

$ sudo apt-get install gcc-6

 

4 설치가 안될 때(다른 방법)

$ sudo apt-get update && \

$ sudo apt-get install build-essential software-properties-common -y && \

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \

$ sudo apt-get update && \

$ sudo apt-get install gcc-snapshot -y && \

$ sudo apt-get update && \

$ sudo apt-get install gcc-6 g++-6 -y && \

$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \

$ sudo update-alternatives --config gcc

#참고https://gist.github.com/73fd6f4bf1be6600a2cf9f56315a2d91.git



댓글