klo*_*lor 3 debian dependencies apt debian-stretch
使用 Debian Stretch v9.11。
我尝试安装 build-essential,但由于未满足的依赖关系而失败:
sudo apt install build-essential
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:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: g++ (>= 4:6.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
apt-cache 策略显示:
apt-cache policy
Package files:
100 /var/lib/dpkg/status
release a=now
500 http://security.debian.org/debian-security stretch/updates/non-free amd64 Packages
release v=9,o=Debian,a=oldstable,n=stretch,l=Debian-Security,c=non-free,b=amd64
origin security.debian.org
500 http://security.debian.org/debian-security stretch/updates/contrib amd64 Packages
release v=9,o=Debian,a=oldstable,n=stretch,l=Debian-Security,c=contrib,b=amd64
origin security.debian.org
500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
release v=9,o=Debian,a=oldstable,n=stretch,l=Debian-Security,c=main,b=amd64
origin security.debian.org
500 http://deb.debian.org/debian stretch/non-free amd64 Packages
release v=9.11,o=Debian,a=oldstable,n=stretch,l=Debian,c=non-free,b=amd64
origin deb.debian.org
500 http://deb.debian.org/debian stretch/contrib amd64 Packages
release v=9.11,o=Debian,a=oldstable,n=stretch,l=Debian,c=contrib,b=amd64
origin deb.debian.org
500 http://deb.debian.org/debian stretch/main amd64 Packages
release v=9.11,o=Debian,a=oldstable,n=stretch,l=Debian,c=main,b=amd64
origin deb.debian.org
Run Code Online (Sandbox Code Playgroud)
我在 /etc/apt/sources.list 中有以下内容:
# deb cdrom:[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 DVD Binary-1 20180714-10:25]/ stretch contrib main
deb http://deb.debian.org/debian stretch main contrib non-free
deb-src http://deb.debian.org/debian stretch main contrib non-free
# deb http://deb.debian.org/debian stretch-updates main
# deb-src http://deb.debian.org/debian stretch-updates main
# deb http://deb.debian.org/debian-security/ stretch/updates main
# deb-src http://deb.debian.org/debian-security/ stretch/updates main
deb http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free
# add backports
# deb http://ftp.debian.org/debian stretch-backports main
# stretch-updates, previously known as 'volatile'
# A network mirror was not selected during install. The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#
# deb http://deb.debian.org/debian/ stretch-updates main contrib
# deb-src http://deb.debian.org/debian/ stretch-updates main contrib
Run Code Online (Sandbox Code Playgroud)
EDIT1:apt-cache 策略 libc6-dev 显示:
apt-cache policy libc6-dev
libc6-dev:
Installed: (none)
Candidate: 2.24-11+deb9u4
Version table:
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
Run Code Online (Sandbox Code Playgroud)
apt-cache 策略 g++ 显示:
apt-cache policy g++
g++:
Installed: (none)
Candidate: 4:6.3.0-4
Version table:
4:6.3.0-4 500
500 http://deb.debian.org/debian stretch/main amd64 Packages
Run Code Online (Sandbox Code Playgroud)
EDIT2:
我deb http://ftp.de.debian.org/debian buster main
在/etc/apt/sources.list.d/.mc.list
我记得,有一次我不得不安装一个更新的 mc,它有特定的错误修复。
编辑3:
apt update
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Ign:2 http://deb.debian.org/debian stretch InRelease
Hit:3 http://deb.debian.org/debian stretch Release
Fetched 94.3 kB in 1s (69.7 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
apt-get install --fix-broken
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud)
编辑4:
sudo apt install libc6-dev g++
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.
sudo apt install build-essential
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:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: g++ (>= 4:6.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
编辑5
sudo aptitude -f install build-essential
The following NEW packages will be installed:
build-essential dpkg-dev{a} fakeroot{a} g++{a} g++-6{a} libalgorithm-diff-perl{a} libalgorithm-diff-xs-perl{a} libalgorithm-merge-perl{a} libc-dev-bin{ab} libc6-dev{ab} libdpkg-perl{a} libfakeroot{a} libfile-fcntllock-perl{a} libstdc++-6-dev{a} linux-libc-dev{a} manpages-dev{a} 0 packages upgraded, 16 newly installed, 0 to remove and 0 not upgraded. Need to get 17.9 MB of archives. After unpacking 69.7 MB will be used.
The following packages have unmet dependencies:
libc6-dev : Depends: libc6 (= 2.24-11+deb9u4) but 2.27-6 is installed
libc-dev-bin : Depends: libc6 (< 2.25) but 2.27-6 is installed
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) build-essential [Not Installed]
2) g++ [Not Installed]
3) g++-6 [Not Installed]
4) libc-dev-bin [Not Installed]
5) libc6-dev [Not Installed]
6) libstdc++-6-dev [Not Installed]
Leave the following dependencies unresolved:
7) dpkg-dev recommends build-essential
Accept this solution? [Y/n/q/?]
The following NEW packages will be installed:
dpkg-dev{a} fakeroot{a} libalgorithm-diff-perl{a}
libalgorithm-diff-xs-perl{a} libalgorithm-merge-perl{a}
libdpkg-perl{a} libfakeroot{a} libfile-fcntllock-perl{a}
manpages-dev{a}
The following packages are RECOMMENDED but will NOT be installed: build-essential
0 packages upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 5,267 kB of archives. After unpacking 8,773 kB will be used.
Do you want to continue? [Y/n/?]
Get: 1 http://deb.debian.org/debian stretch/main amd64 libdpkg-perl all 1.18.25 [1,287 kB]
Get: 2 http://deb.debian.org/debian stretch/main amd64 dpkg-dev all 1.18.25 [1,595 kB]
Get: 3 http://deb.debian.org/debian stretch/main amd64 libfakeroot amd64 1.21-3.1 [45.7 kB]
Get: 4 http://deb.debian.org/debian stretch/main amd64 fakeroot amd64 1.21-3.1 [85.6 kB]
Get: 5 http://deb.debian.org/debian stretch/main amd64 libalgorithm-diff-perl all 1.19.03-1 [48.7 kB]
Get: 6 http://deb.debian.org/debian stretch/main amd64 libalgorithm-diff-xs-perl amd64 0.04-4+b2 [11.6 kB]
Get: 7 http://deb.debian.org/debian stretch/main amd64 libalgorithm-merge-perl all 0.08-3 [12.7 kB]
Get: 8 http://deb.debian.org/debian stretch/main amd64 libfile-fcntllock-perl amd64 0.22-3+b2 [35.3 kB]
Get: 9 http://deb.debian.org/debian stretch/main amd64 manpages-dev all 4.10-2 [2,145 kB]
Fetched 5,267 kB in 0s (15.0 MB/s)
Selecting previously unselected package libdpkg-perl.
(Reading database ... 38475 files and directories currently installed.)
Preparing to unpack .../0-libdpkg-perl_1.18.25_all.deb ...
Unpacking libdpkg-perl (1.18.25) ...
Selecting previously unselected package dpkg-dev.
Preparing to unpack .../1-dpkg-dev_1.18.25_all.deb ...
Unpacking dpkg-dev (1.18.25) ...
Selecting previously unselected package libfakeroot:amd64.
Preparing to unpack .../2-libfakeroot_1.21-3.1_amd64.deb ...
Unpacking libfakeroot:amd64 (1.21-3.1) ...
Selecting previously unselected package fakeroot.
Preparing to unpack .../3-fakeroot_1.21-3.1_amd64.deb ...
Unpacking fakeroot (1.21-3.1) ...
Selecting previously unselected package libalgorithm-diff-perl.
Preparing to unpack .../4-libalgorithm-diff-perl_1.19.03-1_all.deb ...
Unpacking libalgorithm-diff-perl (1.19.03-1) ...
Selecting previously unselected package libalgorithm-diff-xs-perl.
Preparing to unpack .../5-libalgorithm-diff-xs-perl_0.04-4+b2_amd64.deb ...Unpacking libalgorithm-diff-xs-perl (0.04-4+b2) ...
Selecting previously unselected package libalgorithm-merge-perl.
Preparing to unpack .../6-libalgorithm-merge-perl_0.08-3_all.deb ...
Unpacking libalgorithm-merge-perl (0.08-3) ...
Selecting previously unselected package libfile-fcntllock-perl.
Preparing to unpack .../7-libfile-fcntllock-perl_0.22-3+b2_amd64.deb ...
Unpacking libfile-fcntllock-perl (0.22-3+b2) ...
Selecting previously unselected package manpages-dev.
Preparing to unpack .../8-manpages-dev_4.10-2_all.deb ...
Unpacking manpages-dev (4.10-2) ...
Setting up libdpkg-perl (1.18.25) ...
Setting up libfile-fcntllock-perl (0.22-3+b2) ...
Setting up dpkg-dev (1.18.25) ...
Processing triggers for libc-bin (2.27-6) ...
Setting up libfakeroot:amd64 (1.21-3.1) ...
Setting up libalgorithm-diff-perl (1.19.03-1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up manpages-dev (4.10-2) ...
Setting up fakeroot (1.21-3.1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up libalgorithm-merge-perl (0.08-3) ...
Setting up libalgorithm-diff-xs-perl (0.04-4+b2) ...
Processing triggers for libc-bin (2.27-6) ...
[master 77f42a4] committing changes in /etc after apt run
13 files changed, 28 insertions(+)
create mode 120000 alternatives/faked.1.gz
create mode 120000 alternatives/faked.es.1.gz
create mode 120000 alternatives/faked.fr.1.gz
create mode 120000 alternatives/faked.sv.1.gz
create mode 120000 alternatives/fakeroot
create mode 120000 alternatives/fakeroot.1.gz
create mode 120000 alternatives/fakeroot.es.1.gz
create mode 120000 alternatives/fakeroot.fr.1.gz
create mode 120000 alternatives/fakeroot.sv.1.gz
create mode 100644 dpkg/shlibs.default
create mode 100644 dpkg/shlibs.override
create mode 100644 ld.so.conf.d/fakeroot-x86_64-linux-gnu.conf
sudo aptitude -f install build-essential
The following NEW packages will be installed:
build-essential g++{a} g++-6{a} libc-dev-bin{ab}
libc6-dev{ab} libstdc++-6-dev{a} linux-libc-dev{a}
0 packages upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 12.6 MB of archives. After unpacking 60.9 MB will be used.
The following packages have unmet dependencies:
libc6-dev : Depends: libc6 (= 2.24-11+deb9u4) but 2.27-6 is installed
libc-dev-bin : Depends: libc6 (< 2.25) but 2.27-6 is installed
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) build-essential [Not Installed]
2) g++ [Not Installed]
3) g++-6 [Not Installed]
4) libc-dev-bin [Not Installed]
5) libc6-dev [Not Installed]
6) libstdc++-6-dev [Not Installed]
Accept this solution? [Y/n/q/?]
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
apt install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you haverequested 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:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: g++ (>= 4:6.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
结果还是一样。
与此同时,我升级到 Debian v9.12。
apt --dry-run install libc6=2.24-11+deb9u4
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
glibc-doc locales
The following packages will be REMOVED:
libc-bin locales sudo
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, 0 newly installed, 1 downgraded, 3 to remove and 0 not upgraded.
Remv locales [2.27-6]
Remv libc-bin [2.27-6]
Remv sudo [1.8.23-2]
Inst libc6 [2.27-6] (2.24-11+deb9u4 Debian:9.12/oldstable [amd64])
Conf libc6 (2.24-11+deb9u4 Debian:9.12/oldstable [amd64])
Run Code Online (Sandbox Code Playgroud)
我可以试试apt --dry-run install libc6=2.24-11+deb9u4
吗?
如何修复未满足的依赖项?
在这里你的问题是,在某个时间点,您可以从其中载有更新的源安装包libc6
,并且该版本的libc6
得到安装。现在您的软件包已损坏,因为该libc6-dev
软件包的版本为2.24-11+deb9u4
,但 libc6 软件包位于2.27-6
. 这可能是因为您提到的 buster 存储库。
这里的大问题是,由于 buster 是 debian 版本,如果您在源代码中使用它的时间足够长,那么您的系统中可能已经安装了许多软件包。如果你真的只是为了安装 mc,那么解决方案可能会更简单。
这是你可以做的。
将您的系统升级到 buster。这对您来说可能不是一个好的解决方案,但是如果您将源替换为 buster,并进行 dist-upgrade,一切都应该没问题。毕竟,Buster 是一个稳定版本。不过,您可能需要考虑一下,因为它是一个完整的系统升级,并且根据您的系统安装的内容,这可能会破坏您提供的服务。
降级您的 libc6 软件包。这很可能会破坏您的系统,所以要小心。通常这样做是个坏主意,除非您知道自己在做什么。请阅读全文,不要盲目复制命令。
您可能也升级了其他软件包,因为我不知道 buster 源在您的计算机上活动了多长时间。首先,您需要安装正确的libc6
软件包,您需要其中的版本2.24-11+deb9u4
(根据您帖子中的输出)。因此,您需要执行以下操作。
发出
apt --dry-run install libc6=2.24-11+deb9u4
Run Code Online (Sandbox Code Playgroud)
命令。在命令输出中,您将看到如下内容:
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
e2fsprogs libext2fs2 (due to e2fsprogs) libc-bin
Run Code Online (Sandbox Code Playgroud)
软件包列表可能很谨慎,但对于每个软件包,您都需要使用apt-cache policy
. 您需要具有最大版本号的版本,该版本未在本地安装。记录版本号并请求具有该确切版本号的软件包进行安装。您应该将--dry-run
开关添加到 apt 命令,因为这些软件包可能会依次破坏其他软件包(这不太可能,但最好确定一下)。您可能会遇到libext2fs2
Stretch 中不存在的 。你可以放心地忽略那个,但是如果你遇到其他不能降级的包,你应该记录它们,稍后再查找。通常,让apt
处理删除那些是安全的。
获得所有版本号后,将所有软件包提供给apt
,请求您记录的版本号,因此您最终会得到一长串(ish)软件包列表,如下所示(您的列表可能更长,具体取决于您的软件包数量)从 Buster 存储库安装):
apt --dry-run install e2fslibs=1.43.4-2+deb9u1 \
e2fsprogs=1.43.4-2+deb9u1\
libc-bin=2.24-11+deb9u4 \
libc6=2.24-11+deb9u4
Run Code Online (Sandbox Code Playgroud)
如果您在输出中没有看到任何“必要的软件包将被删除”的消息,您可以在没有--dry-run
开关的情况下安全地发出命令,并且您的系统将不会有任何损坏的软件包。如果确实看到该消息,则还需要在命令中包含这些包。迭代直到命令不尝试删除任何必要的包。但是请注意,将卸载一些软件包,如果需要,您可能需要手动重新安装它们(但此时,(重新)安装不应造成任何问题或损坏的软件包)。
这就是为什么在系统上使用不同版本的存储库是个坏主意。
最后我在另一个论坛得到了帮助: https://serverfault.com/a/1004951/302842
这是降级有问题的软件包的解决方案:
apt install libc6/stretch libc6-dev/stretch libc-dev-bin/stretch libc-bin/stretch locales/stretch sudo/stretch
Run Code Online (Sandbox Code Playgroud)
降级成功!
归档时间: |
|
查看次数: |
13419 次 |
最近记录: |