0

I tried to upgrade using apt-get upgrade and got this error message:

insserv: Starting DbSecuritySpt depends on monit and therefore on system facility `$all' which can not be true!
insserv: Starting DbSecuritySpt depends on monit and therefore on system facility `$all' which can not be true!
insserv: Starting DbSecuritySpt depends on monit and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing package util-linux (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 util-linux
E: Sub-process /usr/bin/dpkg returned an error code (1)

If I tried to remove util-linux getting below error 

root@e2e-34-223:~# apt-get remove util-linux
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 linux-image-4.4.0-31-generic : Depends: initramfs-tools but it is not going to be installed or
                                         linux-initramfs-tool
                                Recommends: grub-pc but it is not going to be installed or
                                            grub-efi-amd64 but it is not going to be installed or
                                            grub-efi-ia32 but it is not going to be installed or
                                            grub but it is not going to be installed or
                                            lilo but it is not going to be installed
 linux-image-4.4.0-31-lowlatency : Depends: initramfs-tools but it is not going to be installed or
                                            linux-initramfs-tool
                                   Recommends: grub-pc but it is not going to be installed or
                                               grub-efi-amd64 but it is not going to be installed or
                                               grub-efi-ia32 but it is not going to be installed or
                                               grub but it is not going to be installed or
                                               lilo but it is not going to be installed
 policykit-1 : Depends: libpam-systemd but it is not going to be installed
 systemd : Depends: util-linux (>= 2.27.1) but it is not going to be installed
           Recommends: libpam-systemd but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
karel
  • 114,770

2 Answers2

1

Run sudo apt-get -f install with no other parameters. That should fix the problem.

The issue occurred because you tried to upgrade packages which depend on others, but those aren't going to be installed. Therefore, the dependencies haven't met and the installation fails.

If you want to perform package updates (no operating system upgrades), it's best to do it via the Update Manager (based on my experience). It's the safest and easiest way.

na-no.
  • 846
  • I tries with above command also getting the same error and i have server on cloud so not able to access update manager – Sanjay Kumbhale Apr 06 '18 at 09:16
  • @SanjayKumbhale Try running "sudo apt-get install initramfs-tools grub-pc grub-efi-amd64 grub-efi-ia32 grub lilo libpam-systemd util-linux" (without quotes). That should fix the problem since it adds the depending packages. – na-no. Apr 07 '18 at 11:02
-1

You might try what is recommended in command output - run apt-get -f install alone and repeat the process with upgrade again.

But generally, I have a bad experience with upgrade command - it just does not works all the time. Personally, I prefer to use configuration tools such as Ansible and reinstall Ubuntu with every new version completely while keeping an old version of the system in a cloud (such as AWS) just to be sure nothing goes wrong.

By the way, I really recommend you to use LVM snapshots on root partition before trying upgrade command just in case something goes wrong.

Koss645
  • 47
  • 2