这是 Debian-10.4 的全新安装。sources.list 文件如下:
# deb cdrom:[Debian GNU/Linux 10.4.0 Buster - Official amd64 DVD Binary-1 20200 0509-10:26]/ buster contrib main
deb http://security.debian.org/debian-security buster/updates main contrib
deb-src http://security.debian.org/debian-security buster/updates main contrib
# buster-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/ buster-updates main contrib
deb-src http://deb.debian.org/debian/ buster-updates main contrib
当我尝试安装 sshd (openssh-serverr) 我得到这个:
[root@smb4-a ~]# apt install -f 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: openssh-client (= 1:7.9p1-10+deb10u1) but 1:7.9p1-10+deb10u2 is to be installed
Depends: openssh-sftp-server but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我什至不会去想象什么样的发行版不提供作为基本安装的一部分的安全远程访问。无论 Debian 的原因是什么,我都需要这样。问题似乎是这样的:
openssh-server : Depends: openssh-client (= 1:7.9p1-10+deb10u1) but 1:7.9p1-10+deb10u2 is to be installed
如何强制安装损坏的依赖项?
更多信息:
[root@smb4-a ~]# apt-get update
Get:1 http://deb.debian.org/debian buster-updates InRelease [49.3 kB]
Hit:2 http://security.debian.org/debian-security buster/updates InRelease
Get:3 http://deb.debian.org/debian buster-updates/main Sources [3,088 B]
Get:4 http://deb.debian.org/debian buster-updates/main amd64 Packages [7,380 B]
Get:5 http://deb.debian.org/debian buster-updates/main Translation-en [5,166 B]
Fetched 64.9 kB in 0s (358 kB/s)
Reading package lists... Done
[root@smb4-a ~]# apt-get 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 policy openssh-*
openssh-sftp-server:
Installed: (none)
Candidate: 1:7.9p1-10+deb10u1
Version table:
1:7.9p1-10+deb10u1 500
500 http://security.debian.org/debian-security buster/updates/main amd64 Packages
openssh-tests:
Installed: (none)
Candidate: 1:7.9p1-10+deb10u1
Version table:
1:7.9p1-10+deb10u1 500
500 http://security.debian.org/debian-security buster/updates/main amd64 Packages
openssh-server:
Installed: (none)
Candidate: 1:7.9p1-10+deb10u1
Version table:
1:7.9p1-10+deb10u1 500
500 http://security.debian.org/debian-security buster/updates/main amd64 Packages
openssh-client:
Installed: 1:7.9p1-10+deb10u2
Candidate: 1:7.9p1-10+deb10u2
Version table:
*** 1:7.9p1-10+deb10u2 100
100 /var/lib/dpkg/status
1:7.9p1-10+deb10u1 500
500 http://security.debian.org/debian-security buster/updates/main amd64 Packages
似乎在安装过程中,您对“使用网络镜像?”的问题回答了“否”,因此您的系统配置为没有镜像(或者您在安装过程中可能没有网络连接)。顺便说一句,这由您的 sources.list 指示:
所以现在你有一个不完整的
sources.list
,其中包含更新和安全修复,但不包含基本系统。我不知道 DVD 行是如何从您的 中注释掉的sources.list
,因为如果没有网络镜像,安装程序不会将其删除。您必须配置镜像才能正确安装软件包。将此行添加到您的
sources.list
:并运行
apt update
。之后,您可以安装openssh-server
.您可能希望将镜像切换到离您更近的位置,这可以通过更改
us
URL 的一部分以对应于您的国家或提供不同的镜像来完成。镜像站点列表可在此处获得。或者,您可以安装该
netselect-apt
软件包,它将搜索您附近最快的镜像。附带说明:Debian 确实提供了一个安全的远程 shell,您所要做的就是在安装过程中在“软件选择”页面上勾选“SSH 服务器”(为什么默认情况下不选择它,我无法理解,但仍然如此)。