Ubuntu install SSH server: Openssh-server failed

Source: Internet
Author: User
Tags ssh server

Openssh-client is installed by default in Ubuntu, so when installing SSH, just install openssh-server, and install the software in the process of a similar problem:

When installing Openssh-server, it is found to be dependent on: openssh-client. However, due to the current system comes with openssh-client version than the required version, that is, the version is incompatible, resulting in SSH installation failure.
This software installation problem arises mainly from the source problem. In order to be able to install successfully, we first need to uninstall the high version of Openssh-client, and then the installation of SSH. But enter directly:

sudo apt-get remove openssh-client , but cannot be deleted directly. A problem with the lookup, or the source. The actual concrete steps are as follows:
1.
Delete the contents of the Sources.list, remove the connection to the source, note: Back up the source before deleting

sudo cp /etc/apt/sources.list /ETC/APT/SOURCES.LIST_BK

sudo echo "" >/etc/apt/sources.list
2. Sudo apt-getupdate
3. Sudo apt-get upgrade
4. Sudo apt-get remove openssh-client
: After you have modified the above source, you can delete the Openssh-client
5.
Restore the contents of the Sources.list

sudo mv/etc/apt/sources.list_bk sudo cp/etc/apt/sources.list
6. sudo apt-get update
7. Sudo apt-get upgrade
8.
try to install SSH

sudo apt-get install SSH

The result is new problem, hint: dpkg: deal with XXX (--configure) error;

Here's how to fix it:

1. Rename the info folder now

$ sudo mv/var/lib/dpkg/info/var/lib/dpkg/info_old

2. Create a new info folder

$ sudo mkdir/var/lib/dpkg/info

3. $sudo apt-get Update

4. install SSH again to successfully

$apt-get-finstall SSH

5. After the last step, you will generate some files under the new Info folder, and now move the files to the Info_old folder

$ sudo mv/var/lib/dpkg/info/*/var/lib/dpkg/info_old

6.$ sudo rm-rf/var/lib/dpkg/info

7.$ sudo mv/var/lib/dpkg/info_old/var/lib/dpkg/info

8. Check if SSH is installed successfully, there is an sshd description is OK

$sudo Ps–e | Grepssh

9. start the SSH service

$sudo servicessh Start

Ubuntu install SSH server: Openssh-server failed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.