美文网首页
Centos C开发环境

Centos C开发环境

作者: 单矢sandy | 来源:发表于2020-03-21 16:20 被阅读0次

    gcc环境的卸载

    1. 查看gcc的安装版本
    [root@localhost ~]# rpm -q gcc
    gcc-4.8.5-39.el7.x86_64
    
    1. 执行卸载命令
    [root@localhost ~]# rpm -e gcc-4.8.5-39.el7.x86_64
    错误:依赖检测失败:
        gcc = 4.8.5-39.el7 被 (已安裝) gcc-c++-4.8.5-39.el7.x86_64 需要
    
    1. 卸载依赖的软件
    [root@localhost ~]# rpm -e gcc-c++-4.8.5-39.el7.x86_64
    
    1. 卸载gcc
    [root@localhost ~]# rpm -e gcc-4.8.5-39.el7.x86_64
    
    1. 检查卸载结果
    [root@localhost ~]# gcc -v
    -bash: /usr/bin/gcc: 没有那个文件或目录
    

    gcc手动安装

    1. 下载gcc安装包
      gcc官方网站下载特别慢,推荐到[清华大学开源软件镜像站](https://mirrors.tuna.tsinghua.edu.cn/)下载,地址[gcc](https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/)
    2. 解压软件包
    tar -zxvf gcc-9.3.0.tar.gz
    cd gcc-9.3.0
    
    1. 安装依赖
    ./contrib/download_prerequisites
    
    1. 编译并安装
    ../gcc-5.5.0/configure --prefix=/usr/local/gcc5 --enable-checking=release --enable-languages=c,c++ --disable-multilib
    make && make install
    

    gcc使用yum安装

    [root@localhost dandelion]# yum install -y gcc gcc-c++ kernel-devel
    

    相关文章

      网友评论

          本文标题:Centos C开发环境

          本文链接:https://www.haomeiwen.com/subject/dooyyhtx.html