我遇到了以下问题apt
:每当我尝试时upgrade
,install
或者--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:
这里要考虑的主要错误是
安装
libc-bin
应该修复你的ldd
错误locale
:如果失败,您可以下载必要的软件包并手动安装它们,就像您对 ; 所做的那样
libc-bin
;您需要确保所有相关软件包使用相同的版本,因此对于 Debian 11: