9

When I try and run sudo apt-get upgrade I get the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up libpam-systemd:amd64 (204-5ubuntu20.7) ...
start: Job failed to start
invoke-rc.d: initscript systemd-logind, action "start" failed.
dpkg: error processing package libpam-systemd:amd64 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 libpam-systemd:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

This is preventing me installing some things and obviously something has gone wrong. Does anyone know how to debug?

James I
  • 91
  • http://askubuntu.com/questions/448961/subprocess-installed-post-installation-script-returned-error-exit-status-247 here you can see how to debug post-installation scripts to find out the error – Pablo Hinojosa Jan 06 '16 at 00:34
  • A reinstall of the libpam package is suggested here, but they dont say if it helped them in the end: http://ubuntuforums.org/showthread.php?t=2281366 – Gasp0de Mar 04 '16 at 13:49

2 Answers2

0

I banged my head around this with one of our legacy systems today. This question was one of the first results when Googling around. So I'm leaving an answer here.

The issue is related to https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1325142

It was closed as a won't fix for the libpam-systemd package, but the long queue of comments contained some hints on how to fix it temporarly to overcome installation problems.

We went for commenting the service restarts invoke-rc.d systemd-logind start || exit $? in

/var/lib/dpkg/info/libpam-systemd\:amd64.postinst

and

/var/lib/dpkg/info/libpam-systemd\:amd64.prerm

Then running the apt-get install command with fix flag set:

apt-get -f install

And restored the previous versions of the installer scripts.

Surely, not the nicest 'solution', yet it got us going to install other packages.

0

try it

kernel.kptr_restrict = 1

or (re)move the file

/etc/sysctl.d/10-kernel-hardening.conf

Now the update process can complete :)

Nullpointer
  • 1,161
  • 3
  • 15
  • 32