Can't install GLPI(apache2) on 23.10 (E: Unable to correct problems, you have held broken packages.)

After having wasted over 1h trying to install netbox based on How to Install NetBox Network Documentation and Management Tool on Ubuntu 22.04 I decided to give glpi a shot as it seemed easier.

At least according to https://computingforgeeks.com/how-to-install-glpi-on-ubuntu-linux/

But of course nothing is simple with Linux and nothing ends up working as it's generally the case when trying to deploy latest on latest.

For the netbox procedure I was able to complete most of it but of without any surprise it ended up not working while I followed (several) online sources.

Concerning glpi I am now at the very last step before I can access it and, surprise, I am getting errors on what should be basic manipulations:

[/opt]$ sudo apt install apache2
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 resolve the situation:

The following packages have unmet dependencies:
 apache2-bin : Depends: libaprutil1-dbd-sqlite3 but it is not installable or
                        libaprutil1-dbd-mysql but it is not installable or
                        libaprutil1-dbd-odbc but it is not installable or
                        libaprutil1-dbd-pgsql but it is not installable or
                        libaprutil1-dbd-freetds but it is not installable
 libaprutil1-ldap : Depends: libaprutil1 (= 1.6.3-1ubuntu1) but 1.6.3-1ubuntu1.1 is to be installed
E: Unable to correct problems, you have held broken packages.
[/opt]$ sudo apt install libaprutil1 -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libaprutil1 is already the newest version (1.6.3-1ubuntu1.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[/opt]$ sudo apt install apache2
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 resolve the situation:

The following packages have unmet dependencies:
 apache2-bin : Depends: libaprutil1-dbd-sqlite3 but it is not installable or
                        libaprutil1-dbd-mysql but it is not installable or
                        libaprutil1-dbd-odbc but it is not installable or
                        libaprutil1-dbd-pgsql but it is not installable or
                        libaprutil1-dbd-freetds but it is not installable
 libaprutil1-ldap : Depends: libaprutil1 (= 1.6.3-1ubuntu1) but 1.6.3-1ubuntu1.1 is to be installed
E: Unable to correct problems, you have held broken packages.
[/opt]$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly 
[/opt]$ sudo apt dist-upgrade -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Of course I can read and the most interesting errors from above, for me, was:
libaprutil1-ldap : Depends: libaprutil1 (= 1.6.3-1ubuntu1) but 1.6.3-1ubuntu1.1 is to be installed
and also this one:
libaprutil1 is already the newest version (1.6.3-1ubuntu1.1).

So can anybody teach me why I am getting apache2-bin : Depends: libaprutil1-dbd-mysql but it is not installable when I clearly have it installed?

[/opt]$ sudo dpkg -l | grep -i libapr
ii  libapr1:amd64                                               1.7.2-3                                       amd64        Apache Portable Runtime Library
ii  libaprutil1:amd64                                           1.6.3-1ubuntu1.1                              amd64        Apache Portable Runtime Utility Library
[/opt]$ 

I had a kind of the same issue once.

It turned out that some of the dependencies (already installed on my system) were too new (they originatedfrom a PPA).
Apt refused to downgrade but also refused to install and gave me almost the same kind of confusing errors that you got.

I removed the PPA, and then I removed the dependencies that it told me it couldn't install.
In your case it would be this command that will get rid of these pesky dependencies:

sudo apt purge libapr*

Then clean the packet cache

sudo apt autoremove
sudo apt clean

Only after purging all the dependencies that it wanted, I installed what I needed
in your case that would be:

sudo apt install apache2

This worked for me. Maybe it will work for you too.

P.S. removing the dependencies using my example also removes "libapriltag*" if it exists on your system anyway and which is only installed if you use the application "apriltag" (which I highly doubt)

3 Likes

Thanks I ended up giving it another shot after having reinstalled my system with 23.10 and by following the official instructions it ended up working like a charm.

3 Likes