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
    • 最新
    • 标签
主页 / server / 问题 / 1004890
Accepted
klor
klor
Asked: 2020-02-28 12:10:29 +0800 CST2020-02-28 12:10:29 +0800 CST 2020-02-28 12:10:29 +0800 CST

Debian 9.12 中的 libc6 依赖项不匹配

  • 772

我在 Debian 9.12 中遇到了以下 libc6 依赖问题。

sudo apt install libc6-dev

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:
 libc6-dev : Depends: libc6 (= 2.24-11+deb9u4) but 2.27-6 is to be installed
             Depends: libc-dev-bin (= 2.24-11+deb9u4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我该如何解决?

EDIT1:apt策略libc6

libc6:
  Installed: 2.27-6
  Candidate: 2.27-6
  Version table:
 *** 2.27-6 100
        100 /var/lib/dpkg/status
     2.24-11+deb9u4 500
        500 http://deb.debian.org/debian stretch/main amd64 Packages
     2.24-11+deb9u1 500
        500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages

编辑2:

apt install libc6/stretch libc6-dev/stretch libc-dev-bin/stretch
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '2.24-11+deb9u4' (Debian:9.12/oldstable [amd64]) for 'libc6'
Selected version '2.24-11+deb9u4' (Debian:9.12/oldstable [amd64]) for 'libc6-dev'
Selected version '2.24-11+deb9u4' (Debian:9.12/oldstable [amd64]) for 'libc-dev-bin'
The following additional packages will be installed:
linux-libc-dev
Suggested packages:
glibc-doc locales
The following packages will be REMOVED:
libc-bin locales sudo
The following NEW packages will be installed:
libc-dev-bin libc6-dev linux-libc-dev
The following packages will be DOWNGRADED:
libc6
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
libc-bin
0 upgraded, 3 newly installed, 1 downgraded, 3 to remove and 0 not upgraded.
Need to get 6,797 kB of archives.
After this operation, 1,437 kB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
?]
linux debian dependencies debian-stretch libc6
  • 2 2 个回答
  • 9868 Views

2 个回答

  • Voted
  1. Best Answer
    Piotr P. Karwasz
    2020-02-29T00:51:53+08:002020-02-29T00:51:53+08:00

    您将系统配置为一次使用来自多个发行版的软件包(所谓的 Frankenstein-Debian),因此依赖性错误是正常的。cat /etc/apt/sources.list{,.d/*.list}在bash中运行以列出所有源。

    您的libc6 (version 2.27-6) 卡在了stretch (version 2.24-11+deb9u4) 和buster (version 2.28-10) 之间。我的猜测是你从buster中提取了一些包,而它仍然是测试发行版。解决这个问题最简单的方法是:

    1. 在您的 APT 来源中找到对testing或buster的引用。如果你发现类似的东西:

      deb http://deb.debian.org/debian testing main non-free contrib
      

      将其替换为:

      deb http://deb.debian.org/debian buster main non-free contrib
      

      因为buster不再是测试分布(靶心是)。

    2. 更新软件包列表:

      apt update
      
    3. 将您的libc6升级到buster的版本:

      apt install libc6/buster libc6-dev/buster libc-dev-bin/buster
      
    4. 考虑在不久的将来升级到 Debian 10以拥有来自同一发行版的所有软件包。

    编辑:似乎您的版本高于 Stretch 的软件包很少,因此您可以降级它们:

    apt install libc6/stretch libc6-dev/stretch libc-dev-bin/stretch libc-bin/stretch locales/stretch sudo/stretch
    

    并从 APT 来源中删除buster和 company。

    • 6
  2. AveryFreeman
    2022-09-03T21:57:08+08:002022-09-03T21:57:08+08:00

    我刚刚从 DebianStretch迁移到SidWSL 时遇到了同样的问题,这就是为什么我在这个问题上寻找解决方案的原因。

    幸运的是,我能够相当容易地缓解它。

    对于您的问题的特定 WSL 答案,我深表歉意,但我在这里提到的任何不特定于 WSL 的内容也应该适用于常规 Debian 发行版。两个平台上的包都是一样的。

    对于特定于 WSL 的命令转换的示例,如果您不使用 WSL,则可以替换wsl --terminate Debian为systemctl reboot,或wsl -u root以 root 身份登录到新重新启动的系统。

    以下是我解决libc我遇到的不匹配问题的方法:

    我从本地 Debian 镜像下载了文件并手动安装了它们libc6。libcrypt .deb

    如果在执行特权命令时遇到问题,因为我是由于libc不匹配,您可以运行wsl -u root以进入 WSL 容器(在常规 Debian 中,只需直接以 root 用户身份登录)。

    .deb在 WSL 中,为您的 s创建一个文件夹并用于wget获取这两个文件(链接为 amd64 版本):

    libc6 2.34: http: //ftp.us.debian.org/debian/pool/main/g/glibc/libc6_2.34-4_amd64.deb

    libcrypt1_4.4.28-2: http: //ftp.us.debian.org/debian/pool/main/libx/libxcrypt/libcrypt1_4.4.28-2_amd64.deb

    如果您没有wget,并且显然无法运行apt以安装它,您将不得不尝试curl -O $LINK,或下载其中任何一个的二进制分发版(Google for it)。

    libc首先使用安装dpkg:

    # dpkg -i libc6_2.34-4_amd64.deb
    

    然后安装libcrypt:

    # dpkg -i libcrypt1_4.4.18-4_amd64.deb
    

    在像WSL 提示符和CMD 提示符(如果不是 WSL 则重新启动机器)这样的大型 OS 基础架构更新之后,然后再次输入(如果不是 WSL,则以libcroot身份登录)。这基本上与您可以在 WSL 中重新启动一样接近。exitwsl --terminate Debianwsl -u root

    然后尝试运行apt dist-upgrade -y(确保您最近使用apt update之前刷新了 apt 缓存),它应该将系统的其余部分拉到libc6 2.34为 Bookworm 安装创建的新依赖高原。

    基本上,这里的想法是在您可以自动运行升级之前添加尽可能多的软件包。对我来说,这两个包。

    如果您收到要运行的消息apt --fix-broken install,请尝试一下,然后再试apt dist-upgrade一次。

    apt upgrade与之前运行的其他说明相反,apt dist-upgrade现在不需要这样做,因为您已经安装了大件。如果你愿意,你可以先做,或者遇到问题。

    我也遇到了这个小问题:

    Preparing to unpack .../util-linux_2.38.1-1_amd64.deb ...
    Unpacking util-linux (2.38.1-1) over (2.29.2-1+deb9u1) ...
    dpkg: error processing archive /var/cache/apt/archives/util-linux_2.38.1-1_amd64.deb (--unpack):
     trying to overwrite '/bin/findmnt', which is also in package mount 2.29.2-1+deb9u1
    dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
    Errors were encountered while processing:
     /var/cache/apt/archives/util-linux_2.38.1-1_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    TL;DR,如果您只想要命令,我将它放在最后的扰流板之下。如果您更愿意按照我如何到达那里的过程进行操作,请继续阅读...

    这基本上可能发生在任意数量的软件包上,在这种情况下,它试图util-linux使用不兼容的已安装版本进行mount安装。为了验证情况是否如此,我运行了这个for小循环,它分别检查两个冲突包的可升级包(2>/dev/null过滤掉那个烦人的WARNING: Cli interface blah blah消息):

    # for i in util-linux mount; do apt list --upgradable 2>/dev/null | grep $i; done
    
    util-linux/unstable 2.38.1-1 amd64 [upgradable from: 2.29.2-1+deb9u1]
    mount/unstable 2.38.1-1 amd64 [upgradable from: 2.29.2-1+deb9u1]
    

    如果您的冲突包不同,只需$i反映您正在检查apt list --upgradable列表的任何包,例如for systemd systemd-resolved; do ...包名称可能是什么。

    如果它们都出现在列表中,宾果游戏,它们需要使用不同的时间安装,或者在我的情况下需要在安装冲突版本时覆盖其中一个。

    dpkg有个flag叫--force-overwrite,但是怎么跑进去apt?国旗-o!

    # apt -o Dpkg::Options::="--force-overwrite" --fix-broken install
    

    剧透你可能应该把它添加到你dist-upgrade回到开头的路上

    # apt -o Dpkg::Options::="--force-overwrite" dist-upgrade
    

    毕竟,重新启动您的系统(exit, C:\> wsl --terminate Debian)并再次输入它,这次是作为您的普通用户,看看是否像现在sudo这样passwd工作。

    也可以查看升级是否有反映:

    $ clear && uname -a; cat /etc/debian_version; cat -n /etc/os-release
    
    Linux marmot 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 GNU/Linux
    bookworm/sid
    
         1  PRETTY_NAME="Debian GNU/Linux bookworm/sid"
         2  NAME="Debian GNU/Linux"
         3  ID=debian
         4  HOME_URL="https://www.debian.org/"
         5  SUPPORT_URL="https://www.debian.org/support"
         6  BUG_REPORT_URL="https://bugs.debian.org/"
    
    

    安装neofetch更有趣的识别:

    $ neofetch
    
           _,met$$$$$gg.          avery@marmot
        ,g$$$$$$$$$$$$$$$P.       ------------
      ,g$$P"     """Y$$.".        OS: Debian GNU/Linux bookworm/sid on Windows 10 x  ,$$P'              `$$$.     Kernel: 5.10.102.1-microsoft-standard-WSL2
    ',$$P       ,ggs.     `$$b:   Uptime: 22 hours, 27 mins
    `d$$'     ,$P"'   .    $$$    Packages: 399 (dpkg)
     $$P      d$'     ,    $$P    Shell: bash 5.2.0
     $$:      $$.   -    ,d$$'    Terminal: Windows Terminal
     $$;      Y$b._   _,d$P'      CPU: Intel i5-6300U (4) @ 2.495GHz
     Y$$.    `.`"Y$$$$P"'         Memory: 71MiB / 6219MiB
      `Y$$
       `Y$$.
         `$$b.
           `Y$$b.
              `"Y$b._
    

    希望这可以帮助某人。

    • 0

相关问题

  • 多操作系统环境的首选电子邮件客户端

  • 你最喜欢的 Linux 发行版是什么?[关闭]

  • 更改 PHP 的默认配置设置?

  • 保护新的 Ubuntu 服务器 [关闭]

  • (软)Ubuntu 7.10 上的 RAID 6,我应该迁移到 8.10 吗?

Sidebar

Stats

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

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve