WSL(Win10子系统 ) g++编译环境安装一直报错

问题

The following packages have unmet dependencies:
 g++ : Depends: g++-7 (>= 7.4.0-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages

原因

Ubuntu 20.04.1 LTS 版本跟apt源不匹配,使用最新的阿里源即可

解决方法

查看版本信息

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

更换APT源

cat > /etc/apt/sources.list <

 

你可能感兴趣的:(环境配置)