package openssh-server 1:7.2p2-4ubuntu2.1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Bug #1621925 reported by Surendra
60
This bug affects 14 people
Affects Status Importance Assigned to Milestone
openssh (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

I was trying to install openssh server and I got following error

$ sudo apt-get install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  ncurses-term openssh-sftp-server ssh-import-id
Suggested packages:
  ssh-askpass rssh molly-guard monkeysphere
The following NEW packages will be installed:
  ncurses-term openssh-server openssh-sftp-server ssh-import-id
0 upgraded, 4 newly installed, 0 to remove and 290 not upgraded.
Need to get 636 kB of archives.
After this operation, 5,145 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 ncurses-term all 6.0+20160213-1ubuntu1 [249 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 openssh-sftp-server amd64 1:7.2p2-4ubuntu2.1 [38.8 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 openssh-server amd64 1:7.2p2-4ubuntu2.1 [338 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 ssh-import-id all 5.5-0ubuntu1 [10.2 kB]
Fetched 636 kB in 3s (161 kB/s)
Preconfiguring packages ...
Selecting previously unselected package ncurses-term.
(Reading database ... 227909 files and directories currently installed.)
Preparing to unpack .../ncurses-term_6.0+20160213-1ubuntu1_all.deb ...
Unpacking ncurses-term (6.0+20160213-1ubuntu1) ...
Selecting previously unselected package openssh-sftp-server.
Preparing to unpack .../openssh-sftp-server_1%3a7.2p2-4ubuntu2.1_amd64.deb ...
Unpacking openssh-sftp-server (1:7.2p2-4ubuntu2.1) ...
Selecting previously unselected package openssh-server.
Preparing to unpack .../openssh-server_1%3a7.2p2-4ubuntu2.1_amd64.deb ...
Unpacking openssh-server (1:7.2p2-4ubuntu2.1) ...
Selecting previously unselected package ssh-import-id.
Preparing to unpack .../ssh-import-id_5.5-0ubuntu1_all.deb ...
Unpacking ssh-import-id (5.5-0ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Processing triggers for systemd (229-4ubuntu4) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Setting up ncurses-term (6.0+20160213-1ubuntu1) ...
Setting up openssh-sftp-server (1:7.2p2-4ubuntu2.1) ...
Setting up openssh-server (1:7.2p2-4ubuntu2.1) ...
Creating SSH2 RSA key; this may take some time ...
2048 SHA256:98ONRH/YVE1YPZXLZhT5Z9fChL53mOp6YvItMWkQ45o root@surendra-Vostro-1540 (RSA)
Creating SSH2 DSA key; this may take some time ...
1024 SHA256:oDGGUWnfPR9vSlBpv9iGW0rNt6O4Wi2MyNtr8UuDpE4 root@surendra-Vostro-1540 (DSA)
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:dbNroDlYygcS7RP67wQXTEEFnDDwnFcHiOa48tbKx3g root@surendra-Vostro-1540 (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:jcZcAoYAv8v8T/JvGcvo+zx4WJo5DBL6WkekEOxCBtk root@surendra-Vostro-1540 (ED25519)
Job for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details.
invoke-rc.d: initscript ssh, action "start" failed.
dpkg: error processing package openssh-server (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up ssh-import-id (5.5-0ubuntu1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Errors were encountered while processing:
 openssh-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: openssh-server 1:7.2p2-4ubuntu2.1
ProcVersionSignature: Ubuntu 4.4.0-34.53-generic 4.4.15
Uname: Linux 4.4.0-34-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
Date: Fri Sep 9 19:38:56 2016
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2016-07-21 (50 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.1
 apt 1.2.10ubuntu1
SourcePackage: openssh
Title: package openssh-server 1:7.2p2-4ubuntu2.1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Surendra (surennadkarni) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

From the log:
Sep 09 19:38:56 hostname sshd[11183]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Sep 09 19:38:56 hostname sshd[11183]: error: Bind to port 22 on :: failed: Address already in use.
Sep 09 19:38:56 hostname sshd[11183]: fatal: Cannot bind any address.
Sep 09 19:38:56 hostname systemd[1]: Failed to start OpenBSD Secure Shell server.
Sep 09 19:38:56 hostname systemd[1]: ssh.service: Failed with result 'exit-code'.
Sep 09 19:39:32 hostname sshd[11683]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Sep 09 19:39:32 hostname sshd[11683]: error: Bind to port 22 on :: failed: Address already in use.
Sep 09 19:39:32 hostname sshd[11683]: fatal: Cannot bind any address.
Sep 09 19:39:32 hostname systemd[1]: Failed to start OpenBSD Secure Shell server.
Sep 09 19:39:32 hostname systemd[1]: ssh.service: Failed with result 'exit-code'.

It seems you already have some other ssh server (or something else on that port) running.

Since it seems likely to me that this is a local configuration problem, rather than a bug in Ubuntu, I'm marking this bug as Incomplete.

If indeed this is a local configuration problem, you can find pointers to get help for this sort of problem here: http://www.ubuntu.com/support/community

Or if you believe that this is really a bug, then you may find it helpful to read "How to report bugs effectively" http://www.chiark.greenend.org.uk/~sgtatham/bugs.html. We'd be grateful if you would then provide a more complete description of the problem, explain why you believe this is a bug in Ubuntu rather than a problem specific to your system, and then change the bug status back to New.

Changed in openssh (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for openssh (Ubuntu) because there has been no activity for 60 days.]

Changed in openssh (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.