ubuntu 安装ssh-server时出现错误

sources.list文件内容如下:


## Major bug fix updates produced after the final release of the
## distribution.
deb http://old-releases.ubuntu.com/ubuntu/ maverick main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick main restricted
deb http://old-releases.ubuntu.com/ubuntu/ maverick-updates main restricted
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://old-releases.ubuntu.com/ubuntu/ maverick universe
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick universe
deb http://old-releases.ubuntu.com/ubuntu/ maverick-updates universe
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://old-releases.ubuntu.com/ubuntu/ maverick multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick multiverse
deb http://old-releases.ubuntu.com/ubuntu/ maverick-updates multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ maverick-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://us.old-releases.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse
# deb-src http://us.old-releases.ubuntu.com/ubuntu/ maverick-backports main restricted universe multiverse

#remastersys for backup installed system
deb http://www.remastersys.com/ubuntu maverick main



# deb cdrom:[Ubuntu 13.04 _Raring Ringtail_ - Release i386 (20130424)]/ raring main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ raring main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ raring main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ raring-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ raring-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ raring universe
deb-src http://us.archive.ubuntu.com/ubuntu/ raring universe
deb http://us.archive.ubuntu.com/ubuntu/ raring-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ raring-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ raring multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ raring multiverse
deb http://us.archive.ubuntu.com/ubuntu/ raring-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ raring-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu raring-security main restricted
deb-src http://security.ubuntu.com/ubuntu raring-security main restricted
deb http://security.ubuntu.com/ubuntu raring-security universe
deb-src http://security.ubuntu.com/ubuntu raring-security universe
deb http://security.ubuntu.com/ubuntu raring-security multiverse
deb-src http://security.ubuntu.com/ubuntu raring-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu raring partner
# deb-src http://archive.canonical.com/ubuntu raring partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu raring main
deb-src http://extras.ubuntu.com/ubuntu raring main



deb http://mirrors.ustc.edu.cn/ubuntu/ saucy main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ saucy-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ saucy-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ saucy-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ saucy-backports main restricted universe multiverse

备份原来的sources.list

cp /etc/apt/sources.list /etc/apt/sources.list.banckup 

替换sources.list

cp /home/hui/Download/sources.list /etc/apt/sources.list

重点内容更新包

sudo apt-get update 

报错,版本不一致

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:5.3p1-3ubuntu3) but 1:5.3p1-3ubuntu4 is to be installed
E: Broken packages

重点内容输入如下命令即可:

sudo apt-get install openssh-client=1:5.3p1-3ubuntu3

然后出现下面的执行过程:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  libpam-ssh keychain openssh-blacklist openssh-blacklist-extra
The following packages will be DOWNGRADED:
  openssh-client
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 299 not upgraded.
Need to get 761kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/main openssh-client 1:5.3p1-3ubuntu3 [761kB]
Fetched 761kB in 1min 48s (7,003B/s)                                                                         
dpkg: warning: downgrading openssh-client from 1:5.3p1-3ubuntu4 to 1:5.3p1-3ubuntu3.
(Reading database ... 124425 files and directories currently installed.)
Preparing to replace openssh-client 1:5.3p1-3ubuntu4 (using .../openssh-client_1%3a5.3p1-3ubuntu3_i386.deb) ...
Unpacking replacement openssh-client ...
Processing triggers for man-db ...
Setting up openssh-client (1:5.3p1-3ubuntu3) ...

安装 openssh-server

sudo apt-get install openssh-server 

提示,标示安装成功

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  rssh molly-guard openssh-blacklist openssh-blacklist-extra
The following NEW packages will be installed:
  openssh-server
0 upgraded, 1 newly installed, 0 to remove and 299 not upgraded.
Need to get 285kB of archives.
After this operation, 778kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ lucid/main openssh-server 1:5.3p1-3ubuntu3 [285kB]
Fetched 285kB in 1min 13s (3,866B/s)                                                                         
Preconfiguring packages ...
Selecting previously deselected package openssh-server.
(Reading database ... 124425 files and directories currently installed.)
Unpacking openssh-server (from .../openssh-server_1%3a5.3p1-3ubuntu3_i386.deb) ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Processing triggers for ufw ...
Processing triggers for man-db ...
Setting up openssh-server (1:5.3p1-3ubuntu3) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
 * Stopping OpenBSD Secure Shell server sshd                                                           [ OK ] 
ssh start/running, process 10119

查看启动

ps -e |grep ssh 

如下:表示启动成功

root@ubuntu:/etc/apt# ps -e|grep ssh
 8396 ?        00:00:00 ssh-agent
11177 ?        00:00:00 sshd
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 要在Ubuntu上进行离线安装SSH服务器,可以按照以下步骤操作: 1. 在另一台联网的电脑上,下载适用于Ubuntu的OpenSSH服务器软件包(通常为.deb文件)以及其所有依赖项。可以从官方网站或任何可信的软件源下载。 2. 将下载的软件包和依赖项文件复制到Ubuntu安装机器上的一个目录,例如/home/user/offline。 3. 在Ubuntu机器上打开终端,进入文件所在目录。例如,使用以下命令:cd /home/user/offline。 4. 安装依赖项。使用dpkg命令按照依赖项的顺序安装所有.deb文件。例如,使用以下命令安装ssh-server.deb:sudo dpkg -i ssh-server.deb。 5. 安装ssh-server。按照同样的方式使用dpkg命令安装SSH服务器软件包。例如,使用以下命令安装openssh-server.deb:sudo dpkg -i openssh-server.deb。 6. 如果安装过程中出现任何依赖项错误,请使用apt-get命令修复依赖项。例如,使用以下命令修复依赖项:sudo apt-get install -f。 7. 完成安装后,运行以下命令启动SSH服务器:sudo service ssh start。 现在,你已经成功地在Ubuntu上进行了离线安装SSH服务器。你可以使用SSH客户端连接到该服务器,并进行必要的配置和管理。要注意,由于离线安装,你需要手动处理软件包的依赖项以确保安装成功。 ### 回答2: 要在Ubuntu上进行离线安装SSH服务器,你需要遵循以下步骤: 第一步,从 Ubuntu 官方网站上下载所需的软件包。你可以在另一台与网络连接的计算机上下载所需的软件包并将其复制到离线 Ubuntu 计算机上。确保下载与你操作系统版本相匹配的软件包。 第二步,将软件包复制到离线 Ubuntu 计算机的某个目录中。你可以使用 USB 驱动器或其他移动存储设备来将软件包复制到离线计算机上。 第三步,打开终端,并在离线计算机上通过运行以下命令安装 SSH 服务器:sudo dpkg -i /path/to/package.deb(将 /path/to/package.deb 替换为软件包的实际路径)。 第四步,安装可能缺失的依赖项。如果在安装过程中出现错误提示缺少依赖项,可以通过运行以下命令来手动安装缺失的软件包:sudo apt-get -f install。 第五步,一旦安装完成,你可以通过运行以下命令来启动 SSH 服务器:sudo service ssh start。 现在你的 Ubuntu 系统已经成功安装SSH 服务器,你可以通过其他计算机上的 SSH 客户端连接到它。注意,你需要了解离线计算机的 IP 地址以及 SSH 端口(默认为22)。 希望这个回答能帮助你进行 UbuntuSSH 服务器的离线安装。 ### 回答3: 要在Ubuntu上离线安装SSH服务器,你可以按照以下步骤进行操作: 1. 在一台有互联网连接的电脑上,使用浏览器打开Ubuntu的官方网站(https://ubuntu.com/),然后下载所需的Ubuntu版本的ISO镜像文件。这个ISO镜像文件包含了完整的Ubuntu操作系统。 2. 将下载的ISO镜像文件拷贝到一台没有互联网连接的电脑上,可以使用U盘或其他可移动存储设备。 3. 在离线电脑上,将ISO镜像文件挂载到一个临目录中。使用以下命令创建一个新的目录来挂载ISO镜像文件: ```bash sudo mkdir /mnt/iso sudo mount -o loop /path/to/ubuntu.iso /mnt/iso ``` 4. 进入挂载的ISO目录: ```bash cd /mnt/iso ``` 5. 安装OpenSSH服务器软件包,使用以下命令: ```bash sudo apt-get install openssh-server ``` 6. 在安装过程中,系统将提示输入管理员用户的密码。输入密码并确认。 7. 安装完成后,可以使用以下命令启动SSH服务: ```bash sudo service ssh start ``` 8. 现在SSH服务器已经安装启动了,你可以从其他计算机上通过SSH客户端连接到这台服务器。 这样,你就可以成功在Ubuntu上离线安装SSH服务器了。记得在安装过程中,确保在离线电脑上已经安装了所需的依赖包和更新。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值