centOS 6.5 yum升级 gcc4.8 然后又退回来4.4
CentOS 6.5 用了很多年了,一直舍不得省7 。
由于要用到 c++ 11 ,所以決定升級一下。
為了省事我選擇用 yum 方式升級,結果最后還是不能用,差點搞壞,這是真機,重裝麻煩了。
get http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
yum install devtoolset-2-gcc-4.8.2 devtoolset-2-gcc-c++-4.8.2
查看 gcc 版本
/opt/rh/devtoolset-2/root/usr/bin/gcc --version
yum install devtoolset-2-gcc-gfortran
ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
hash -r
gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Copyright (C) 2013 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.
看樣子,挺好哈,一切正常。
結果使用的時候
/opt/rh/devtoolset-2/root/usr/libexec/gcc/i686-redhat-linux/4.8.2/ld: lxdialog/checklist.o: undefined reference to symbol 'acs_map'
/opt/rh/devtoolset-2/root/usr/libexec/gcc/i686-redhat-linux/4.8.2/ld: note: 'acs_map' is defined in DSO /lib/libtinfo.so.5 so try adding it to the linker command line
/lib/libtinfo.so.5: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
ln -s /usr/lib/libtinfo.so.5 make
看來還要手工編譯安裝比較靠譜
就要先把這個給刪除掉。
yum remove devtoolset*
然后,手動刪除?/usr/local/bin/ 下面的軟鏈
然后我想,把 gcc remove? 在 install 應該就回來了,結果老是提示 gcc 找不到。
最后我看上面有一句?hash -r
就重新執行了一下, gcc 4.4 終于回來了。
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
Copyright ? 2010 Free Software Foundation, Inc.
?
源碼編譯比較簡單吧,就是慢點。?
轉載于:https://www.cnblogs.com/ningci/p/9347623.html
總結
以上是生活随笔為你收集整理的centOS 6.5 yum升级 gcc4.8 然后又退回来4.4的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 设计模式6+1大原则
- 下一篇: Oozie中允许hive程序xml配置