Ubuntu build-essential依赖libc6-dev问题

执行下面命令,备份 apt 安装源:

$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

vim 编辑 sources.list :

$ sudo vim /etc/apt/sources.list `

将 sources.list 中的内容替换如下

注意:这里是Ubuntu 20.04 LTS的,

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
aptitude : Depends: libcwidget3 but it is not going to be installed                                                                Depends: libncursesw5 (>= 5.6+20070908) but it is not going to be
installed
Depends: libtinfo5 but it is not going to be installed
Recommends: apt-xapian-index but it is not going to be installed
Recommends: libparse-debianchangelog-perl but it is not going to be
installed
E: Unable to correct problems, you have held broken packages. 

我是用源解决了这个问题的

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

$ sudo apt upgrade
$ sudo apt update
还尝试过这些下面命令, 但是不能解决问题 
$ sudo apt update --fix-missing [package]
$ sudo apt install -f [package]

build-essential用处
开机启动Ubuntu ssh

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 好的,以下是使用中文的回答: 要在Ubuntu上安装build-essential,可以使用以下命令: ``` sudo apt-get update sudo apt-get install build-essential ``` 第一条命令将更新可用的软件包列表,第二条命令将安装build-essential及其所有依赖项。 建议在使用sudo命令时格外小心,确保只在需要的时候使用它,并且不要在没有充分了解其含义和作用的情况下使用它。 ### 回答2: ubuntu系统是一种基于Linux的操作系统,相较于其他操作系统具有诸多优点,例如安全、免费等等。在使用ubuntu系统中,经常会用到编程和开发工具,如gcc、make等。要使用这些工具,你需要安装build-essential包。在本文中,我将介绍如何在ubuntu中安装build-essentialbuild-essential包是一种ubuntu中的基本软件包,它包含了一系列编译及构建应用的工具。如果你在ubuntu中使用gcc或g++等开发工具,你需要安装build-essential包。安装build-essential包的过程如下: 1. 打开终端:使用键盘快捷键 ctrl + alt + t, 或者进入应用程序->系统工具->终端。 2. 更新软件包列表:在终端中输入以下命令 sudo apt-get update ,此命令会更新软件包列表。 3. 安装build-essential: 在终端中输入 sudo apt-get install build-essential 命令即可安装该包。 4. 等待安装:在安装过程中,会提示安装包的信息、大小等,确认后输入y进行安装,安装需要时间,具体时间根据网络情况而定。 5. 检查安装: 输入gcc –v 和g++ –v命令来检查工具是否正确安装。如果安装成功,将会显示相应的版本信息。 通过以上步骤,你就可以在ubuntu系统中成功安装build-essential包。该包为你的编程及构建工作带来很大的便利,同时根据需求,你也可以根据需要添加其他的软件包。希望本文对你有所帮助。 ### 回答3: build-essentialUbuntu操作系统中一个常用的软件包,它包括许多在编译和安装其他软件程序时所需要的工具和依赖项,比如GCC编译器、GNU make、libc6-dev等,因此安装build-essential非常有必要。 在Ubuntu中安装build-essential非常简单,用户只需要打开终端,使用apt-get命令进行安装即可。具体步骤如下: 步骤一:打开终端 在Ubuntu操作系统中打开终端非常简单,只需要按下Ctrl+Alt+T组合键即可。也可以在系统菜单中找到终端应用程序进行打开。 步骤二:更新软件包列表 在安装软件包之前,用户需要先更新软件包列表,以保证系统中的所有软件包都是最新的。在终端中输入以下命令: sudo apt-get update 系统会自动更新软件包列表,这可能需要一些时间。 步骤三:安装build-essential 更新软件包列表之后,就可以使用apt-get命令安装build-essential了。在终端中输入以下命令: sudo apt-get install build-essential 系统会自动下载和安装build-essential软件包以及其所有依赖项。安装完成后,用户可以在终端中输入以下命令进行验证: gcc --version 如果返回GCC版本信息,则说明build-essential已经成功安装了。 总之,安装build-essential对于从事开发工作的Ubuntu用户来说是非常重要的,通过简单的命令行操作就可以完成。除此之外,用户还可以使用Ubuntu软件中心来安装build-essential,方法也很简单,只需要在软件中心中搜索“build-essential”并点击安装即可。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值