Broken Packages during Icinga2 installation

Previously i was installed icinga2 10.5 & i have removed icinga2 & trying to install icinga2 agaain looks like it is installing r2.11.2-1… when i am installing i am getting the below errors… can someone help me on this?
/etc/icinga2# apt-get -f install icinga2 icinga2-common icinga2-bin
Reading package lists… Done
Building dependency tree
Reading state information… Done
icinga2 is already the newest version (2.11.2-1.bionic).
icinga2-bin is already the newest version (2.11.2-1.bionic).
icinga2-common is already the newest version (2.11.2-1.bionic).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 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 icinga2-common (2.11.2-1.bionic) …
chown: cannot access ‘/etc/icinga2/icinga2.conf’: No such file or directory
dpkg: error processing package icinga2-common (–configure):
installed icinga2-common package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of icinga2-bin:
icinga2-bin depends on icinga2-common (= 2.11.2-1.bionic); however:
Package icinga2-common is not configured yet.

dpkg: error processing package icinga2-bin (–configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of icinga2:
icinga2 depends on icinga2-bin (= 2.11.2-1.bionic); however:
Package icinga2-bin is not configured yet.
icinga2 depends on icinga2-common (= 2.11.2-1.bionic); however:
Package icinga2-common is not configured yet.

dpkg: error processing package icinga2 (–configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
icinga2-common
icinga2-bin
icinga2
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@SLC-ICINGA2-01:/etc/icinga2# icinga2 --versioin

Hi,

What exactly is the scope here? Upgrade, reinstall or install from scratch?

You have packages from previous installation that haven’t finished configuring and are stack midway.

Cheers,
George

1 Like

I have been trying to reinstall the Icinga2… at this time issue is resolved… I would like to understand what is the best way to reinstall or upgrade the all icinga2 packages … Can you please provide me instructions on this?

Hi,

For every upgrade one should always check the documentation for special notes and actions and act appropriately. Then in your case it is just a matter of:

apt-get update && apt-get upgrade
(to upgrade everything in your system, which one should do at regular intervals)
OR
apt-get update && apt-get install icinga2
(this will just update icinga2 packages and all the requirements)

It is important to check that apt/dpkg exits without errors. If there are errors, you probably have issues from previous actions.

In this case, you had removed the icinga2.conf file, apt could not find it and refused to finish the setup of the package. Which left the whole system in a broken state.

Cheers,
George

2 Likes