欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

在Win10的Linux子系统安装build-essential失败问题解决办法

程序员文章站 2022-03-20 14:40:33
...

使用系统:ubuntu64位18.04LTS
问题:为了在WIN10系统下的VScode平台上编译px4固件,参考教程搭建环境。
https://blog.csdn.net/redbugler/article/details/85047618
安装在Win10的Linux子系统时,参考教程:https://blog.csdn.net/zhangdongren/article/details/82663977
因自带镜像源下载超慢,此教程最后修改为阿里云的镜像源,但在安装build-essential时,出现如下错误:

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:
 build-essential : Depends: libc6-dev but it is not going to be installed or
                            libc-dev
                   Depends: g++ (>= 4:4.4.3) but it is not going to be installed
                   Depends: dpkg-dev (>= 1.13.5) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

搜索解决办法是用aptitude 替换apt-get,但易将apt搞没,没敢试。
解决办法:最后在阿里云开发者社区找到适用于系统的最新的镜像源,替换教程中的源,安装成功。

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

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

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

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

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