我删除是openssh-server
因为我突然无法ssh连接到它(我昨天可以正常连接它)。我想openssh-server
通过使用重新安装sudo apt-get install openssh-server
,但它无法再安装,它显示E: Unable to correct problems, you have held broken packages.
。里面有详细的日志。
$sudo apt-get install openssh-server
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:
openssh-server : Depends: adduser (>= 3.9) but it is not going to be installed
Depends: dpkg (>= 1.9.0) but it is not going to be installed
Depends: libpam-modules (>= 0.72-9) but it is not going to be installed
Depends: libpam-runtime (>= 0.76-14) but it is not going to be installed
Depends: openssh-client (= 1:7.4p1-10+deb9u7) but it is not going to be installed
Depends: openssh-sftp-server but it is not going to be installed
Depends: procps but it is not going to be installed
Depends: ucf (>= 0.28) but it is not going to be installed
Depends: debconf (>= 0.5) but it is not going to be installed or
debconf-2.0
Depends: init-system-helpers (>= 1.18~) but it is not going to be installed
Depends: libaudit1 (>= 1:2.2.1) but it is not going to be installed
Depends: libc6 (>= 2.17) but it is not going to be installed
Depends: libcomerr2 (>= 1.01)
Depends: libgssapi-krb5-2 (>= 1.14+dfsg) but it is not going to be installed
Depends: libkrb5-3 (>= 1.13~alpha1+dfsg) but it is not going to be installed
Depends: libpam0g (>= 0.99.7.1) but it is not going to be installed
Depends: libselinux1 (>= 1.32) but it is not going to be installed
Depends: libssl1.0.2 (>= 1.0.2d) but it is not going to be installed
Depends: libsystemd0 but it is not going to be installed
Depends: libwrap0 (>= 7.6-4~) but it is not going to be installed
Depends: zlib1g (>= 1:1.1.4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
$sudo aptitude install openssh-server
The following NEW packages will be installed:
openssh-server openssh-sftp-server{a}
The following packages are RECOMMENDED but will NOT be installed:
ncurses-term
0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 323 kB of archives. After unpacking 923 kB will be used.
The following packages have unmet dependencies:
libc6 : Breaks: openssh-server (< 1:8.1p1-5) but 1:7.4p1-10+deb9u7 is to be installed
open: 1; closed: 0; defer: 0; conflict: 0 .The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) openssh-server [Not Installed]
Accept this solution? [Y/n/q/?] n
*** No more solutions available ***
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) openssh-server [Not Installed]
Accept this solution? [Y/n/q/?] Y
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.
我在网上搜索并尝试了很多解决方案,但没有一个有效
- https://askubuntu.com/questions/223237/unable-to- Correct-problems-you-have-held-broken-packages
- https://askubuntu.com/questions/285605/how-to-fix-broken-packages
- https://stackoverflow.com/questions/56409321/openssh-server-installation-results-in-error-e-unable-to- Correct-problems-you
其中有我卸载前的信息openssh-server
。
昨天,我用 编译了 ffmpeg --enable-ssl
,但显示错误:openssl not found
。我搜索了互联网并知道我应该安装该软件包libssl-dev
。然后我使用命令sudo apt-get install libssl-dev
。它还显示一个错误,例如
libssl-dev : Depends: libssl1.1 (= 1.1.0l-1~deb9u3) but 1.1.1k-1 is to be installed
Unable to Correct Problems You have Held Broken Packages
我在网上搜索并得到了一些答案。然后我使用命令sudo apt-get install libssl1.1=1.1.0l-1~deb9u3
。它有效并修复了错误。此时,同一个库的两个不同版本libssl
在我的系统上共存。一个是libssl1.0.2
,另一个是libssl1.1
。
今天,我发现我无法 ssh 连接到我的系统。我想卸载openssh-server
并重新安装它。但我收到了上面显示的错误。是因为我的系统中有同一个库的两个不同版本吗?当我尝试删除 时libssl1.0.2
,但我发现许多库依赖于它。当我尝试删除时libssl1.1
,它显示错误depends: dh-autoreconf (>= 12) but it is not going to be installed. Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages
这是我的系统的信息。
$uname -a
Linux linaro-alip 4.4.189 #24 SMP Tue Jul 21 17:01:59 CST 2020 aarch64 GNU/Linux
$cat /proc/version
Linux version 4.4.189 (rpdzkj@rpdzkj) (gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05) ) #24 SMP Tue Jul 21 17:01:59 CST 2020
$lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.13 (stretch)
Release: 9.13
Codename: stretch
$apt policy
Package files:
100 /var/lib/dpkg/status
release a=now
100 http://mirrors.ustc.edu.cn/debian stretch-backports/contrib arm64 Packages
release o=Debian Backports,a=stretch-backports,n=stretch-backports,l=Debian Backports,c=contrib,b=arm64
origin mirrors.ustc.edu.cn
100 http://mirrors.ustc.edu.cn/debian stretch-backports/non-free arm64 Packages
release o=Debian Backports,a=stretch-backports,n=stretch-backports,l=Debian Backports,c=non-free,b=arm64
origin mirrors.ustc.edu.cn
100 http://mirrors.ustc.edu.cn/debian stretch-backports/main arm64 Packages
release o=Debian Backports,a=stretch-backports,n=stretch-backports,l=Debian Backports,c=main,b=arm64
origin mirrors.ustc.edu.cn
500 http://mirrors.ustc.edu.cn/debian-security stretch/updates/main arm64 Packages
release v=9,o=Debian,a=oldoldstable,n=stretch,l=Debian-Security,c=main,b=arm64
origin mirrors.ustc.edu.cn
500 http://mirrors.ustc.edu.cn/debian stretch/contrib arm64 Packages
release v=9.13,o=Debian,a=oldoldstable,n=stretch,l=Debian,c=contrib,b=arm64
origin mirrors.ustc.edu.cn
500 http://mirrors.ustc.edu.cn/debian stretch/non-free arm64 Packages
release v=9.13,o=Debian,a=oldoldstable,n=stretch,l=Debian,c=non-free,b=arm64
origin mirrors.ustc.edu.cn
500 http://mirrors.ustc.edu.cn/debian stretch/main arm64 Packages
release v=9.13,o=Debian,a=oldoldstable,n=stretch,l=Debian,c=main,b=arm64
origin mirrors.ustc.edu.cn
Pinned packages:
$ apt policy openssh-{server,client}
openssh-server:
Installed: (none)
Candidate: 1:7.4p1-10+deb9u7
Version table:
1:7.4p1-10+deb9u7 500
500 http://mirrors.ustc.edu.cn/debian stretch/main arm64 Packages
1:7.4p1-10+deb9u6 500
500 http://mirrors.ustc.edu.cn/debian-security stretch/updates/main arm64 Packages
openssh-client:
Installed: 1:7.4p1-10+deb9u7
Candidate: 1:7.4p1-10+deb9u7
Version table:
*** 1:7.4p1-10+deb9u7 500
500 http://mirrors.ustc.edu.cn/debian stretch/main arm64 Packages
100 /var/lib/dpkg/status
1:7.4p1-10+deb9u6 500
500 http://mirrors.ustc.edu.cn/debian-security stretch/updates/main arm64 Packages