AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 703434
Accepted
Jingqiang Zhang
Jingqiang Zhang
Asked: 2022-05-23 00:10:08 +0800 CST2022-05-23 00:10:08 +0800 CST 2022-05-23 00:10:08 +0800 CST

如何在 debian 11 上安装 gcc 和 build-essential?

  • 772

在/etc/apt/sources.list中,允许的来源是

deb http://deb.debian.org/debian buster main contrib non-free
deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
deb http://deb.debian.org/debian buster-updates main contrib non-free
deb http://emacs.ganneff.de/ buster main

我安装了这些软件包

$ sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev

其中一些无法安装。输出消息是

Hit:1 http://deb.debian.org/debian buster InRelease
Hit:2 http://deb.debian.org/debian-security buster/updates InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Hit:4 http://emacs.ganneff.de buster InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
curl is already the newest version (7.64.0-4+deb10u2).
make is already the newest version (4.2.1-1.2).
make set to manually installed.
wget is already the newest version (1.21-1+deb11u1).
xz-utils is already the newest version (5.2.5-2.1~deb11u1).
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:
 dpkg-dev : Depends: libdpkg-perl (= 1.19.7) but 1.20.9 is to be installed
        Recommends: fakeroot
        Recommends: libalgorithm-merge-perl but it is not going to be installed
 g++ : Depends: cpp (= 4:8.3.0-1) but 4:10.2.1-1 is to be installed
 gcc : Depends: cpp (= 4:8.3.0-1) but 4:10.2.1-1 is to be installed
 libbz2-dev : Depends: libbz2-1.0 (= 1.0.6-9.2~deb10u1) but 1.0.8-4 is to be installed
          Recommends: bzip2-doc but it is not going to be installed
 libc6-dev : Depends: libc6 (= 2.28-10+deb10u1) but 2.31-13+deb11u2 is to be installed
         Depends: libc-dev-bin (= 2.28-10+deb10u1) but it is not going to be installed
 libfontconfig1-dev : Depends: libfontconfig1 (= 2.13.1-2) but 2.13.1-4.2 is to be installed
                  Depends: libexpat1-dev but it is not going to be installed
                  Depends: uuid-dev but it is not going to be installed
 libfreetype6-dev : Depends: libfreetype6 (= 2.9.1-3+deb10u2) but 2.10.4+dfsg-1 is to be installed
                Depends: libpng-dev but it is not going to be installed
 liblzma-dev : Depends: liblzma5 (= 5.2.4-1+deb10u1) but 5.2.5-2.1~deb11u1 is to be installed
 libncurses-dev : Depends: libtinfo6 (= 6.1+20181013-2+deb10u2) but 6.2+20201114-2 is to be installed
              Depends: libncurses6 (= 6.1+20181013-2+deb10u2) but 6.2+20201114-2 is to be installed
              Depends: libncursesw6 (= 6.1+20181013-2+deb10u2) but 6.2+20201114-2 is to be installed
 libncursesw5-dev : Depends: libtinfo6 (= 6.1+20181013-2+deb10u2) but 6.2+20201114-2 is to be installed
 libsqlite3-dev : Depends: libsqlite3-0 (= 3.27.2-3+deb10u1) but 3.34.1-3 is to be installed
 libssl-dev : Depends: libssl1.1 (= 1.1.1n-0+deb10u2) but 1.1.1n-0+deb11u2 is to be installed
 libx11-dev : Depends: libx11-6 (= 2:1.6.7-1+deb10u2) but 2:1.7.2-1 is to be installed
          Depends: libxau-dev (>= 1:1.0.0-1) but it is not going to be installed
          Depends: libxcb1-dev but it is not going to be installed
 libxext-dev : Depends: libxext6 (= 2:1.3.3-1+b2) but 2:1.3.3-1.1 is to be installed
 libxml2-dev : Depends: libxml2 (= 2.9.4+dfsg1-7+deb10u3) but 2.9.10+dfsg-6.7 is to be installed
 libxmlsec1-dev : Depends: libgcrypt20-dev but it is not going to be installed
              Depends: libgnutls28-dev but it is not going to be installed
              Depends: libnss3-dev but it is not going to be installed
              Depends: libxmlsec1 (= 1.2.27-2) but 1.2.31-1 is to be installed
              Depends: libxmlsec1-nss (= 1.2.27-2) but 1.2.31-1 is to be installed
              Depends: libxslt1-dev (>= 1.0.20) but it is not going to be installed
 libxt-dev : Depends: libxt6 (= 1:1.1.5-1+b3) but 1:1.2.0-1 is to be installed
         Depends: libsm-dev but it is not going to be installed
 zlib1g-dev : Depends: zlib1g (= 1:1.2.11.dfsg-1+deb10u1) but 1:1.2.11.dfsg-2+deb11u1 is to be installed
E: Unable to correct problems, you have held broken packages.

为什么这么多依赖不匹配?如何安装它们?

debian gcc
  • 1 1 个回答
  • 1813 Views

1 个回答

  • Voted
  1. Best Answer
    Jingqiang Zhang
    2022-05-23T01:01:12+08:002022-05-23T01:01:12+08:00

    问题是由于错误的配置名称。我编辑了/etc/apt/sources.list如下

    deb http://deb.debian.org/debian bullseye main
    deb-src http://deb.debian.org/debian bullseye main
    
    deb http://deb.debian.org/debian-security/ bullseye-security main
    deb-src http://deb.debian.org/debian-security/ bullseye-security main
    
    deb http://deb.debian.org/debian bullseye-updates main
    deb-src http://deb.debian.org/debian bullseye-updates main
    

    它完美地工作。

    官方 SourcesList 文档在这里:

    https://wiki.debian.org/SourcesList

    • 1

相关问题

  • GRUB 配置以识别同一 Linux 发行版的不同桌面环境(安装)

  • astyle 不会更改源文件格式

  • 接收有关全新 Debian 的电子邮件

  • Debian Stretch:libgs_plugin_systemd-updates.so 中的 gnome-software 段错误

  • 如何在拼音输入法中输入ü?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve