I suggest something like: sudo dpkg --purge openssh-server sudo rm -f /etc/rc*/*02ssh /etc/init.d/ssh sudo apt-get install openssh-server
With the release of 16.04 LTS, some packages, including openssh-server, are started via systemd unit files rather than the sysv-init compatibility scripts. Once your sshd is installed again, check the output of e.g. systemctl list-units '*ssh*' Thanks ** Changed in: openssh (Ubuntu) Status: New => Invalid -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to openssh in Ubuntu. https://bugs.launchpad.net/bugs/1616614 Title: package openssh-server 1:7.2p2-4ubuntu2.1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 102 Status in openssh package in Ubuntu: Invalid Bug description: I was trying to use ssh but it did not seem to be installed. the file "/usr/bin/ssh" was installed the init files were missing. I decided to add the init.d and rc5.d files. I was still unable to start ssh so I decided to just re-install openssh. As you can this did not go well. It seems I took careful aim at my foot and shot my kneecap off. root@sunup:/etc/init.d# apt 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: 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 17 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://archive.ubuntu.com/ubuntu xenial/main amd64 ncurses-term all 6.0+20160213-1ubuntu1 [249 kB] Get:2 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 openssh-sftp-server amd64 1:7.2p2-4ubuntu2.1 [38.8 kB] Get:3 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 openssh-server amd64 1:7.2p2-4ubuntu2.1 [338 kB] Get:4 http://archive.ubuntu.com/ubuntu xenial/main amd64 ssh-import-id all 5.5-0ubuntu1 [10.2 kB] Fetched 636 kB in 1s (406 kB/s) Preconfiguring packages ... Selecting previously unselected package ncurses-term. (Reading database ... 217890 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 systemd (229-4ubuntu7) ... Processing triggers for ureadahead (0.100.0-19) ... 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:ifVt+zEPQJaCEM41tTJ7ioq5Nd+zitMECWf48VxwPYY root@sunup (RSA) Creating SSH2 DSA key; this may take some time ... 1024 SHA256:Ffmc6+U+bC44zWx96s/j1Emff2gXzm7JDtpoDdx7AnM root@sunup (DSA) Creating SSH2 ECDSA key; this may take some time ... 256 SHA256:w0a+E7GIGMKbX8p5Ke5jWVMMwwwdzhMcQrnMrywTHCc root@sunup (ECDSA) Creating SSH2 ED25519 key; this may take some time ... 256 SHA256:VufVRjr+gAaupx7MxVN6khhtBgDIecB48rm6Rc2YQbU root@sunup (ED25519) insserv: warning: script is corrupt or invalid: /etc/init.d/../rc5.d/S02ssh invoke-rc.d: not a symlink: /etc/rc5.d/S02ssh dpkg: error processing package openssh-server (--configure): subprocess installed post-installation script returned error exit status 102 Setting up ssh-import-id (5.5-0ubuntu1) ... Processing triggers for ureadahead (0.100.0-19) ... 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) ##################################################################### 1) root@sunup:/etc/init.d# lsb_release -rd Description: Ubuntu 16.04.1 LTS Release: 16.04 2) Unable to determine version information. 3) I expected openssh server to be installed. 4) Install of openssh failed (see the above) Thank You for your time and effort on my behalf. 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.1 Architecture: amd64 Date: Wed Aug 24 14:28:32 2016 ErrorMessage: subprocess installed post-installation script returned error exit status 102 InstallationDate: Installed on 2016-06-09 (75 days ago) InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1) RelatedPackageVersions: dpkg 1.18.4ubuntu1.1 apt 1.2.12~ubuntu16.04.1 SourcePackage: openssh Title: package openssh-server 1:7.2p2-4ubuntu2.1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 102 UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1616614/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp