前言
想使用CLion進行遠程調試,但是發現CLion需求的remote debug用的GDB版本7.8.x-8.2.x ,並不能滿足(CentOS7默認yum裝的是7.6),所以需要給CentOS7裝個新版本的GDB
安裝
1.添加上CentOS SCLo RH庫,裝上gdb8的依賴devtoolset-8-build
sudo yum install centos-release-scl-rh
sudo yum install devtoolset-8-build
2.安裝相應的gdb
sudo yum install devtoolset-8-gdb
3.同樣,也可以安裝相應版本的gcc個g++
sudo yum install devtoolset-8-gcc devtoolset-8-gcc-c++
4.yum安裝完后,原來的gcc不覆蓋,所以需要執行enable腳本更新環境變量
sudo source /opt/rh/devtoolset-8/enable
5.可以通過加入到profile里面開機自動source, vim /etc/profile, 跳到最后一行加入以下內容
source /opt/rh/devtoolset-8/enable
6.結束
參考:
1.https://blog.k-res.net/archives/2449.html
2.https://blog.csdn.net/u012453838/article/details/85286810
