Package g++ is not configured yet.

问题描述

安装依赖包提示Package g++ is not configured yet.

root@ubuntu:/opt# dpkg -i build-essential_12.4ubuntu1_amd64.deb
(Reading database ... 70742 files and directories currently installed.)
Preparing to unpack build-essential_12.4ubuntu1_amd64.deb ...
Unpacking build-essential (12.4ubuntu1) over (12.4ubuntu1) ...
dpkg: dependency problems prevent configuration of build-essential:
 build-essential depends on gcc (>= 4:7.2); however:
  Package gcc is not configured yet.
 build-essential depends on g++ (>= 4:7.2); however:
  Package g++ is not configured yet.

dpkg: error processing package build-essential (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 build-essential

分析过程,可能是安装过程中包版本不一致

root@ubuntu:/opt# dpkg -l |grep gcc
iU  gcc                                    4:7.4.0-1ubuntu2.3                              amd64        GNU C compiler
iU  gcc-7                                  7.5.0-3ubuntu1~18.04                            amd64        GNU C compiler
ii  gcc-7-base:amd64                       7.5.0-3ubuntu1~18.04                            amd64        GCC, the GNU Compiler Collection (base package)
ri  gcc-8-base:amd64                       8.4.0-1ubuntu1~18.04                            amd64        GCC, the GNU Compiler Collection (base package)
iU  libgcc-7-dev:amd64                     7.5.0-3ubuntu1~18.04                            amd64        GCC support library (development files)
ii  libgcc1:amd64                          1:8.4.0-1ubuntu1~18.04                          amd64        GCC support library
root@ubuntu:/opt# dpkg -l | grep g++
iU  g++                                    4:7.3.0-3ubuntu2                                amd64        GNU C++ compiler
iU  g++-7                                  7.5.0-3ubuntu1~18.04                            amd64        GNU C++ compiler

解决办法

apt --fix-broken install 选择Y

查看版本

  root@ubuntu:/opt# gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 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.

root@ubuntu:/opt# g++ --version
g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 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.

查看安装后的包

  root@ubuntu:/opt# dpkg -l | grep gcc
ii  gcc                                    4:7.4.0-1ubuntu2.3                              amd64        GNU C compiler
ii  gcc-7                                  7.5.0-3ubuntu1~18.04                            amd64        GNU C compiler
ii  gcc-7-base:amd64                       7.5.0-3ubuntu1~18.04                            amd64        GCC, the GNU Compiler Collection (base package)
ri  gcc-8-base:amd64                       8.4.0-1ubuntu1~18.04                            amd64        GCC, the GNU Compiler Collection (base package)
ii  libgcc-7-dev:amd64                     7.5.0-3ubuntu1~18.04                            amd64        GCC support library (development files)
ii  libgcc1:amd64                          1:8.4.0-1ubuntu1~18.04                          amd64        GCC support library
root@ubuntu:/opt# dpkg -l | grep g++
ii  g++                                    4:7.3.0-3ubuntu2                                amd64        GNU C++ compiler
ii  g++-7                                  7.5.0-3ubuntu1~18.04                            amd64        GNU C++ compiler
root@ubuntu:/opt# 

相关推荐

最近更新

  1. TCP协议是安全的吗?

    2024-01-25 03:30:01       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-25 03:30:01       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-25 03:30:01       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-25 03:30:01       20 阅读

热门阅读

  1. ABC337(A-C)

    2024-01-25 03:30:01       33 阅读
  2. 死锁面试题详解

    2024-01-25 03:30:01       33 阅读
  3. Koa框架

    2024-01-25 03:30:01       31 阅读
  4. JVM实战(29)——模拟栈内存溢出

    2024-01-25 03:30:01       29 阅读
  5. Docker离线安装

    2024-01-25 03:30:01       32 阅读
  6. 分布式事务理论基础

    2024-01-25 03:30:01       34 阅读
  7. 03 | 事务隔离

    2024-01-25 03:30:01       36 阅读
  8. vant组件库的简单使用

    2024-01-25 03:30:01       41 阅读