ubuntu12.04升级gcc到4.8流程与问题解决

今天要用buildroot,配置完编译的时候提示gcc要4.8以上,我的是.4.4.7所以需要安装高版本的gcc。网上找了教程,链接如下:

ubuntu12.04升级gcc至4.8-CSDN博客

里面写的很好了,但是遇到一个问题,如下:

root@ubuntu:/home/topeet/work100G/newkernel/4412_SCP_5.3.18# sudo add-apt-repository ppa:ubuntu-toolchain-r/test
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 128, in <module>
    ppa_info = get_ppa_info_from_lp(user, ppa_name)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 84, in get_ppa_info_from_lp
    curl.perform()
pycurl.error: (60, 'server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none')

结合了诸多帖子,解决了。

上面报错是说服务器证书认证失败,解决方法简单的说就是重装证书

sudo apt-get install --reinstall ca-certificates

参考链接 第二个链接可以不看的,第一个链接应该就解决了证书认证问题。

ubuntu无法添加PPA的解决办法_ppa 失败-CSDN博客

uBuntu指定gcc版本升级(add-apt-repository)_ubuntu升级gcc版本-CSDN博客

结果:

记录两个常用的指令:

切换gcc版本:

sudo update-alternatives --config gcc

然后会出现选项让人选择哪个版本:

c++编译器也一样,把上面的gcc改成g++即可。

另外贴一下我的ubuntu12.04的软件源,超级好用。

vim /etc/apt/source.list

deb http://old-releases.ubuntu.com/ubuntu precise main universe restricted multiverse                                                                           
 
deb http://old-releases.ubuntu.com/ubuntu precise-security universe main multiverse restricted
 
deb http://old-releases.ubuntu.com/ubuntu precise-updates universe main multiverse restricted
 
deb http://old-releases.ubuntu.com/ubuntu precise-proposed universe main multiverse restricted

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值