zoukankan      html  css  js  c++  java
  • ubuntu 安装 gcc / g++

    执行如下命令:

    sudo apt install build-essential
    

    参考:Ubuntu下gcc安装及使用 - CSDN

    参考:如何在Ubuntu 18.04上安装GCC编译器 - Linux公社


    写在最后:

    如果尝试各种方法后,仍然报错,无法安装;有可能是软件源的问题,需要换回原来的源

    # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    # newer versions of the distribution.
    deb http://archive.ubuntu.com/ubuntu/ focal main restricted
    # deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted
    
    ## Major bug fix updates produced after the final release of the
    ## distribution.
    deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
    # deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
    
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    ## team. Also, please note that software in universe WILL NOT receive any
    ## review or updates from the Ubuntu security team.
    deb http://archive.ubuntu.com/ubuntu/ focal universe
    # deb-src http://archive.ubuntu.com/ubuntu/ focal universe
    deb http://archive.ubuntu.com/ubuntu/ focal-updates universe
    # deb-src http://archive.ubuntu.com/ubuntu/ focal-updates universe
    
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    ## team, and may not be under a free licence. Please satisfy yourself as to
    ## your rights to use the software. Also, please note that software in
    ## multiverse WILL NOT receive any review or updates from the Ubuntu
    ## security team.
    deb http://archive.ubuntu.com/ubuntu/ focal multiverse
    # deb-src http://archive.ubuntu.com/ubuntu/ focal multiverse
    deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse
    # deb-src http://archive.ubuntu.com/ubuntu/ focal-updates multiverse
    
    ## N.B. software from this repository may not have been tested as
    ## extensively as that contained in the main release, although it includes
    ## newer versions of some applications which may provide useful features.
    ## Also, please note that software in backports WILL NOT receive any review
    ## or updates from the Ubuntu security team.
    deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
    # deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
    
    ## Uncomment the following two lines to add software from Canonical's
    ## 'partner' repository.
    ## This software is not part of Ubuntu, but is offered by Canonical and the
    ## respective vendors as a service to Ubuntu users.
    # deb http://archive.canonical.com/ubuntu focal partner
    # deb-src http://archive.canonical.com/ubuntu focal partner
    
    deb http://security.ubuntu.com/ubuntu/ focal-security main restricted
    # deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted
    deb http://security.ubuntu.com/ubuntu/ focal-security universe
    # deb-src http://security.ubuntu.com/ubuntu/ focal-security universe
    deb http://security.ubuntu.com/ubuntu/ focal-security multiverse
    # deb-src http://security.ubuntu.com/ubuntu/ focal-security multiverse
    

    然后:

    sudo apt update  # 更新软件列表
    sudo apt upgrade  # 更新软件
    sudo apt install build-essential  # 安装 build-essential
    
  • 相关阅读:
    解释中国经济奇迹的5本书
    《门口的野蛮人》三部曲,美国的宝万之争专业户
    3星|《城市更新》:欧美东亚中国老城区改造的资料与案例汇编
    3.5星|《哈佛商业评论》2018年第11期:机场的书店很危险,出差的高管可能会被商业新书主张吸引
    3星|《好文案一句话就够了》:10年前一些日本经典广告文案
    5星|林毅夫《解读中国经济》:完美解释中国经济奇迹和现存问题
    iOS:Masonry 英文原档介绍
    iOS:Masonry介绍与使用
    iOS :学习新技术途径和sizeClasses屏幕适配
    iOS:XMPP即时聊天知识
  • 原文地址:https://www.cnblogs.com/xiangsui/p/14056535.html
Copyright © 2011-2022 走看看