Debian 11 でインストール、アップグレード、修復すると、Apt はエラーを返します。

Debian 11 でインストール、アップグレード、修復すると、Apt はエラーを返します。

問題があります。aptまたは、試行するたびにエラーが発生し、何もアップグレード、インストール、または修正されませんupgradeinstall--fix-broken

以下は私が受け取ったエラーの例です。

root@server:~$ apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  libicu63 libperl5.28 libreadline7
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_TIME = "it_IT.UTF-8",
    LC_MONETARY = "it_IT.UTF-8",
    LC_ADDRESS = "it_IT.UTF-8",
    LC_TELEPHONE = "it_IT.UTF-8",
    LC_NAME = "it_IT.UTF-8",
    LC_MEASUREMENT = "it_IT.UTF-8",
    LC_IDENTIFICATION = "it_IT.UTF-8",
    LC_NUMERIC = "it_IT.UTF-8",
    LC_PAPER = "it_IT.UTF-8",
    LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16.
Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17.
Setting up initramfs-tools (0.140) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (0.140) ...
update-initramfs: Generating /boot/initrd.img-5.10.0-21-amd64
E: no ldd around - install libc-bin
update-initramfs: failed for /boot/initrd.img-5.10.0-21-amd64 with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned 
error exit status 1
Errors were encountered while processing:
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

追加情報:

root@server:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/root/work/bin

追加情報 2:

root@server:~$ apt install libc-bin
Reading package lists... Done
Building dependency tree... Done
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:
 libc-bin : Depends: libc6 (< 2.32) but 2.36-8 is to be installed
E: Unable to correct problems, you have held broken packages.

私も以下を実行しました。dpkg --install libc-bin_2.36-8_amd64.deb

追加情報 3:

root@server:~$ apt install locales
Reading package lists... Done
Building dependency tree... Done
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:
 locales : Depends: libc-bin (> 2.31) but it is not going to be installed
           Depends: debconf (>= 0.5) but it is not going to be installed or
                    debconf-2.0
E: Unable to correct problems, you have held broken packages.
root@server:~$ apt install libc-bin
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libc-bin is already the newest version (2.36-8).
The following packages were automatically installed and are no longer required:
  libicu63 libperl5.28 libreadline7
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@server:~$ ldd --version ldd
ldd (Debian GLIBC 2.36-8) 2.36
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

追加情報 4:

root@server:~$ apt policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 100 http://ftp.debian.org/debian bullseye-backports/non-free amd64 Packages
     release o=Debian Backports,a=bullseye-backports,n=bullseye-backports,l=Debian Backports,c=non-free,b=amd64
     origin ftp.debian.org
 100 http://ftp.debian.org/debian bullseye-backports/contrib amd64 Packages
     release o=Debian Backports,a=bullseye-backports,n=bullseye-backports,l=Debian Backports,c=contrib,b=amd64
     origin ftp.debian.org
 100 http://ftp.debian.org/debian bullseye-backports/main amd64 Packages
     release o=Debian Backports,a=bullseye-backports,n=bullseye-backports,l=Debian Backports,c=main,b=amd64
     origin ftp.debian.org
 500 http://security.debian.org/debian-security bullseye-security/main amd64 Packages
     release v=11,o=Debian,a=stable-security,n=bullseye-security,l=Debian-Security,c=main,b=amd64
     origin security.debian.org
 500 http://deb.debian.org/debian bullseye-updates/main amd64 Packages
     release v=11-updates,o=Debian,a=stable-updates,n=bullseye-updates,l=Debian,c=main,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian bullseye/non-free amd64 Packages
     release v=11.6,o=Debian,a=stable,n=bullseye,l=Debian,c=non-free,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian bullseye/contrib amd64 Packages
     release v=11.6,o=Debian,a=stable,n=bullseye,l=Debian,c=contrib,b=amd64
     origin deb.debian.org
 500 http://deb.debian.org/debian bullseye/main amd64 Packages
     release v=11.6,o=Debian,a=stable,n=bullseye,l=Debian,c=main,b=amd64
     origin deb.debian.org
Pinned packages:

ベストアンサー1

ここで考慮すべき主なエラーは、

E: no ldd around - install libc-bin

インストールするとエラーがlibc-bin解決します。lddlocale

sudo apt install libc-bin

失敗した場合は、必要なパッケージをダウンロードして手動でインストールできます。libc-binすべての関連パッケージが同じバージョンを使用していることを確認する必要があります。したがって、Debian 11の場合:

wget http://deb.debian.org/debian/pool/main/g/glibc/locales_2.31-13+deb11u5_all.deb http://deb.debian.org/debian/pool/main/g/glibc/libc6_2.31-13+deb11u5_amd64.deb http://deb.debian.org/debian/pool/main/g/glibc/libc-bin_2.31-13+deb11u5_amd64.deb
sudo dpkg -i *_2.31-13+deb11u5*.deb

おすすめ記事