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

Bug #1685022 reported by bramint on 2017-04-20
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
openssh (Ubuntu)
Low
Colin Watson

Bug Description

I messed up the ssh_config file and I need the stock config files for ssh server.

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: openssh-server 1:7.2p2-4ubuntu2.1
ProcVersionSignature: Ubuntu 4.4.0-72.93-generic 4.4.49
Uname: Linux 4.4.0-72-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.5
AptOrdering:
 openssh-server: Install
 openssh-server: Configure
 NULL: ConfigurePending
Architecture: amd64
Date: Thu Apr 20 14:13:40 2017
DuplicateSignature:
 package:openssh-server:1:7.2p2-4ubuntu2.1
 Setting up openssh-server (1:7.2p2-4ubuntu2.1) ...
 /var/lib/dpkg/info/openssh-server.postinst: 164: /var/lib/dpkg/info/openssh-server.postinst: cannot create /etc/ssh/sshd_config: Directory nonexistent
 dpkg: error processing package openssh-server (--configure):
  subprocess installed post-installation script returned error exit status 2
ErrorMessage: subprocess installed post-installation script returned error exit status 2
InstallationDate: Installed on 2017-04-03 (17 days ago)
InstallationMedia: Ubuntu-Server 16.04.2 LTS "Xenial Xerus" - Release amd64 (20170215.8)
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.1
 apt 1.2.19
SourcePackage: openssh
Title: package openssh-server 1:7.2p2-4ubuntu2.1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 2
UpgradeStatus: No upgrade log present (probably fresh install)

bramint (joe-bram) wrote :
tags: removed: need-duplicate-check
Colin Watson (cjwatson) wrote :

You appear to have manually removed /etc/ssh, so you'll have to recover from that manually too. Reinstall the openssh-client package as follows:

  sudo mkdir -p /etc/ssh
  sudo dpkg --configure openssh-server
  sudo apt install -oDPkg::options::=--force-confmiss --reinstall openssh-client

I've committed a change to my Debian openssh repository to ensure that /etc/ssh exists before trying to create sshd_config within it, which would have helped somewhat with this.

Changed in openssh (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
importance: Undecided → Low
status: New → Fix Committed

Thx

--
____________________________
Joe Saladino [<email address hidden>]
+1(208) 971-7570

> On Apr 21, 2017, at 8:17 PM, Colin Watson <email address hidden> wrote:
>
> You appear to have manually removed /etc/ssh, so you'll have to recover
> from that manually too. Reinstall the openssh-client package as
> follows:
>
> sudo mkdir -p /etc/ssh
> sudo dpkg --configure openssh-server
> sudo apt install -oDPkg::options::=--force-confmiss --reinstall openssh-client
>
> I've committed a change to my Debian openssh repository to ensure that
> /etc/ssh exists before trying to create sshd_config within it, which
> would have helped somewhat with this.
>
> ** Changed in: openssh (Ubuntu)
> Importance: Undecided => Low
>
> ** Changed in: openssh (Ubuntu)
> Status: New => Fix Committed
>
> ** Changed in: openssh (Ubuntu)
> Assignee: (unassigned) => Colin Watson (cjwatson)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1685022
>
> Title:
> package openssh-server 1:7.2p2-4ubuntu2.1 failed to install/upgrade:
> subprocess installed post-installation script returned error exit
> status 2
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1685022/+subscriptions

bramint (joe-bram) wrote :

there should be a way for all packages to get new .conf files after you
make messed up the one you have and you didn't back it up. :-/

Thx.

___________________________
*Joe Saladino* [<email address hidden> <mailto:<email address hidden>>]
*Ph:* (208) 971-7570

On 4/21/17 8:17 PM, Colin Watson wrote:
> You appear to have manually removed /etc/ssh, so you'll have to recover
> from that manually too. Reinstall the openssh-client package as
> follows:
>
> sudo mkdir -p /etc/ssh
> sudo dpkg --configure openssh-server
> sudo apt install -oDPkg::options::=--force-confmiss --reinstall openssh-client
>
> I've committed a change to my Debian openssh repository to ensure that
> /etc/ssh exists before trying to create sshd_config within it, which
> would have helped somewhat with this.
>
> ** Changed in: openssh (Ubuntu)
> Importance: Undecided => Low
>
> ** Changed in: openssh (Ubuntu)
> Status: New => Fix Committed
>
> ** Changed in: openssh (Ubuntu)
> Assignee: (unassigned) => Colin Watson (cjwatson)
>

Colin Watson (cjwatson) wrote :

On Sat, Apr 22, 2017 at 06:22:54AM -0000, bramint wrote:
> there should be a way for all packages to get new .conf files after you
> make messed up the one you have and you didn't back it up. :-/

Removing and then using --force-confmiss in the same way as I explained
there does generally work.

bramint (joe-bram) wrote :

Thx :-)

___________________________
*Joe Saladino* [<email address hidden> <mailto:<email address hidden>>]
*Ph:* (208) 971-7570

On 4/22/17 5:08 AM, Colin Watson wrote:
> On Sat, Apr 22, 2017 at 06:22:54AM -0000, bramint wrote:
>> there should be a way for all packages to get new .conf files after you
>> make messed up the one you have and you didn't back it up. :-/
> Removing and then using --force-confmiss in the same way as I explained
> there does generally work.
>

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openssh - 1:7.5p1-3

---------------
openssh (1:7.5p1-3) experimental; urgency=medium

  * Fix debian/adjust-openssl-dependencies to account for preferring
    libssl1.0-dev.
  * Adjust OpenSSL dependencies for openssh-client-ssh1 too.
  * Fix purge failure when /etc/ssh has already somehow been removed
    (LP: #1682817).
  * Ensure that /etc/ssh exists before trying to create /etc/ssh/sshd_config
    (LP: #1685022).

 -- Colin Watson <email address hidden> Tue, 02 May 2017 13:51:27 +0100

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

Duplicates of this bug

Other bug subscribers