Icinga2 Package can't be installed

Hello, I would like to monitor a new Linux system.

Unfortunately, the installation does not go through, see error:

:~# apt-get install icinga2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 icinga2-bin : Depends: libboost-coroutine1.74.0 (>= 1.74.0) but it is not installable
               Depends: libboost-filesystem1.74.0 (>= 1.74.0) but it is not installable
               Depends: libboost-program-options1.74.0 (>= 1.74.0) but it is not installable
               Depends: libboost-regex1.74.0-icu70 but it is not installable
               Depends: libboost-thread1.74.0 (>= 1.74.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

I don’t quite understand why it can’t install the dependencies?
It is an Ubuntu 22.04.2 LTS Jammy machine.
I would be very grateful for any tips.

did you add the official icinga ubuntu repository?

https://icinga.com/docs/icinga-2/latest/doc/02-installation/02-Ubuntu/#ubuntu-repository

Hello, thanks for the fast response.

I did, due to the firewall SSL decryption the SSL handshake does not work properly. That’s why I put --no-check-certificate after wget. This seems to work so far, at least there is something in the generated file.

apt update
Hit:1 https://packages.icinga.com/ubuntu icinga-jammy InRelease
Err:1 https://packages.icinga.com/ubuntu icinga-jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C6E319C334410682
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.icinga.com/ubuntu icinga-jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C6E319C334410682
W: Failed to fetch http://packages.icinga.com/ubuntu/dists/icinga-jammy/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C6E319C334410682
W: Some index files failed to download. They have been ignored, or old ones used instead.
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:2 and /etc/apt/sources.list.d/jammy-icinga.list:2
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'apt' instead of 'apt-transport-https'
apt is already the newest version (2.4.9).
gnupg is already the newest version (2.2.27-3ubuntu2.1).
wget is already the newest version (1.21.2-2ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
File '/usr/share/keyrings/icinga-archive-keyring.gpg' exists. --2023-11-22 09:56:17--  https://packages.icinga.com/icinga.key
Overwrite? (y/N) Resolving packages.icinga.com (packages.icinga.com)... 185.233.189.126
Connecting to packages.icinga.com (packages.icinga.com)|185.233.189.126|:443... connected.
WARNING: cannot verify packages.icinga.com's certificate, issued by ‘CN=PaloAlto-Trust’:
  Self-signed certificate encountered.
HTTP request sent, awaiting response... 200 OK
Length: 1723 (1.7K) [application/pgp-keys]
Saving to: ‘STDOUT’

-                                                                               100%[====================================================================================================================================================================================================>]   1.68K  --.-KB/s    in 0s

2023-11-22 09:56:17 (1.31 GB/s) - written to stdout [1723/1723]


Enter new filename: /usr/share/keyrings/icinga-archive-keyring.gpg
File '/usr/share/keyrings/icinga-archive-keyring.gpg' exists. Overwrite? (y/N) y
Hit:1 https://packages.icinga.com/ubuntu icinga-jammy InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:2 and /etc/apt/sources.list.d/jammy-icinga.list:2
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:2 and /etc/apt/sources.list.d/jammy-icinga.list:2
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/icinga2.list:1 and /etc/apt/sources.list.d/jammy-icinga.list:1
root@SERVER:~# apt-get install -y icinga2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 icinga2-bin : Depends: libboost-coroutine1.74.0 (>= 1.74.0) but it is not installable
               Depends: libboost-filesystem1.74.0 (>= 1.74.0) but it is not installable
               Depends: libboost-program-options1.74.0 (>= 1.74.0) but it is not installable
               Depends: libboost-regex1.74.0-icu70 but it is not installable
               Depends: libboost-thread1.74.0 (>= 1.74.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

Before that I did it like this, I guess this is no longer supported:

wget -O - https://packages.icinga.com/icinga.key | apt-key add -
echo "deb http://packages.icinga.com/ubuntu icinga-$(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/icinga2.list
echo "deb-src http://packages.icinga.com/ubuntu icinga-$(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/icinga2.list

https://opensource.com/article/22/9/deprecated-linux-apt-key

Hello, I removed the icinga entry:

root@server:~# apt-key list
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
/etc/apt/trusted.gpg.d/ansible.asc
----------------------------------
pub   rsa4096 2014-06-10 [SC]
      6125 E2A8 C77F 2818 FB7B  D15B 93C4 A3FD 7BB9 C367
uid           [ unknown] Launchpad PPA for Ansible, Inc.

/etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg
------------------------------------------------------
pub   rsa4096 2012-05-11 [SC]
      8439 38DF 228D 22F7 B374  2BC0 D94A A3F0 EFE2 1092
uid           [ unknown] Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>

/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg
------------------------------------------------------
pub   rsa4096 2018-09-17 [SC]
      F6EC B376 2474 EDA9 D21B  7022 8719 20D1 991B C93C
uid           [ unknown] Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>

And added the /usr/share/keyrings/icinga-archive-keyring.gpg.

Still I get the error trying to install icinga2:

root@server:~# apt install icinga2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 icinga2-bin : Depends: libboost-coroutine1.74.0 (>= 1.74.0) but it is not installable
               Depends: libboost-filesystem1.74.0 (>= 1.74.0) but it is not installable
               Depends: libboost-program-options1.74.0 (>= 1.74.0) but it is not installable
               Depends: libboost-regex1.74.0-icu70 but it is not installable
               Depends: libboost-thread1.74.0 (>= 1.74.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

Do you have any hints what could cause this?

Bling guess, your icinga’s sources.list is configured for a incompatible release.

1 Like

When I cat /usr/share/keyrings/icinga-archive-keyring.gpg its only gibberish, should this be readable plain text?

It’s a binary file, yes. You’ll get more information when you use file instead of cat.

Hello, I’ve checked icinga2.list:

deb Index of /ubuntu icinga-jammy main
deb-src Index of /ubuntu icinga-jammy main

Version is:
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy

Your third post shows you have configured the repository twice:

  • /etc/apt/sources.list.d/icinga2.list
  • /etc/apt/sources.list.d/jammy-icinga.list

And its content is wrong. It should look like:

deb [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] http://packages.icinga.com/ubuntu icinga-jammy main

Which list do I have to delete? icinga2.list, jammy-icinga.list or does it not matter as long as there is a list with the correct content?

The file name doesn’t matter (as long it ends with .list), choose whatever you prefere.

Hello, I’ve changed the .list accordanly.
But the dependencies error is still the same. :slightly_frowning_face:

topdesk@Server:/etc/apt/sources.list.d$ ls
jammy-icinga.list
topdesk@Server:/etc/apt/sources.list.d$ cat jammy-icinga.list
deb [signed-by=/usr/share/keyrings/icinga-archive-keyring.gpg] http://packages.icinga.com/ubuntu icinga-jammy main
topdesk@Server:/etc/apt/sources.list.d$

You still might have wrong repositories configured somewhere, hence, I’d recommend to check every .list file. Next I’d purge all complaining packages and run a reinstall.