logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache Installation Issue
Author
MCFH



Joined: 03 Mar 2026
Posts: 5
Location: UK, London

PostPosted: Tue 03 Mar '26 11:18    Post subject: Apache Installation Issue Reply with quote

I am trying to install Apache on Debian on a Pi (having accidentally removed it)

Code:
sudo apt-get update
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian-security bookworm-security InRelease
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Hit:4 http://archive.raspberrypi.com/debian bookworm InRelease
Hit:5 https://packages.sury.org/apache2 bookworm InRelease
Hit:6 https://packages.sury.org/php bookworm InRelease
Fetched 55.4 kB in 1s (99.3 kB/s)
Reading package lists... Done


sudo apt-get 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 to resolve the situation:

The following packages have unmet dependencies:
 apache2 : Depends: apache2-data (= 2.4.66-1~deb12u1) but 2.4.66-1+0~20251205.20+debian12~1.gbp6076c7 is to be installed
E: Unable to correct problems, you have held broken packages.


Can anyone tell me what I need to do to fix this?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7470
Location: EU, Germany, Next to Hamburg

PostPosted: Tue 03 Mar '26 11:36    Post subject: Reply with quote

Save your config to your home folder

Code:

sudo dpkg --force-all --configure -a
sudo dpkg --purge --force-depends apache2
sudo apt --fix-broken install
sudo apt-get -f install
sudo apt update
sudo apt upgrade
sudo apt install apache2
Back to top
MCFH



Joined: 03 Mar 2026
Posts: 5
Location: UK, London

PostPosted: Tue 03 Mar '26 11:50    Post subject: Reply with quote

Thank you. OK running through those steps it warns me that

'/var/www/html' and '/etc/apache2/sites-available'

are not empty so not removed when I do the purge
But the install still generates the dependency error
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7470
Location: EU, Germany, Next to Hamburg

PostPosted: Tue 03 Mar '26 16:06    Post subject: Reply with quote

Debian wants to install apache2-data = 2.4.66-1~deb12u1 while your sury has apache2-data = 2.4.66-1+0~20251205.20+debian12~1.gbp6076c7

Code:
sudo apt --fix-broken install
sudo apt-get install apache2=2.4.66-1+0~20251205.20+debian12~1.gbp6076c7


this will install the sury version.

OR

you remove sury from your source list and install the debian apache-
Back to top
MCFH



Joined: 03 Mar 2026
Posts: 5
Location: UK, London

PostPosted: Tue 03 Mar '26 16:53    Post subject: Reply with quote

ok so removing the sury references in the source.list (both php.list and apache.list and running

Code:
sudo apt --fix-broken install
sudo apt-get install apache2


I get
Code:
apache2 : Depends: apache2-data (= 2.4.66-1~deb12u1) but 2.4.66-1+0~20251205.20+debian12~1.gbp6076c7 is to be installed


Running
Code:
sudo apt-get install apache2=2.4.66-1+0~20251205.20+debian12~1.gbp6076c7

(without the Sury list in place)
I get

Code:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package apache2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libapache2-mpm-itk:armhf libapache2-mpm-itk

E: Version '2.4.66-1+0~20251205.20+debian12~1.gbp6076c7' for 'apache2' was not found


It's like something strange has happened to the main apache2 package
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7470
Location: EU, Germany, Next to Hamburg

PostPosted: Wed 04 Mar '26 11:42    Post subject: Reply with quote

okay misunderstanding

For sudo apt-get install apache2=2.4.66-1+0~20251205.20+debian12~1.gbp6076c7

You need the sury repo Smile
Back to top
MCFH



Joined: 03 Mar 2026
Posts: 5
Location: UK, London

PostPosted: Wed 04 Mar '26 12:07    Post subject: Reply with quote

OK so adding the sury repo back in:

Code:
sudo apt-get 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 to resolve the situation:

The following packages have unmet dependencies:
 apache2 : Depends: apache2-data (= 2.4.66-1~deb12u1) but 2.4.66-1+0~20251205.20+debian12~1.gbp6076c7 is to be installed
E: Unable to correct problems, you have held broken packages.


Code:

:/etc/apt/sources.list.d $ sudo apt-get install apache2=2.4.66-1+0~20251205.20+debian12~1.gbp6076c7
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package apache2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libapache2-mpm-itk:armhf libapache2-mpm-itk

E: Version '2.4.66-1+0~20251205.20+debian12~1.gbp6076c7' for 'apache2' was not found
Code:

/etc/apt/sources.list.d $ sudo apt-get install apache2=2.4.66-1+0~20251205.20+debian12~1.gbp6076c7
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package apache2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libapache2-mpm-itk:armhf libapache2-mpm-itk

E: Version '2.4.66-1+0~20251205.20+debian12~1.gbp6076c7' for 'apache2' was not found

Reading state information... Done
Package apache2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libapache2-mpm-itk:armhf libapache2-mpm-itk

E: Version '2.4.66-1+0~20251205.20+debian12~1.gbp60
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7470
Location: EU, Germany, Next to Hamburg

PostPosted: Thu 05 Mar '26 12:07    Post subject: Reply with quote

Code:

sudo apt-get update
sudo apt-get purge apache2 apache2-bin apache2-data apache2-utils
sudo apt-get autoremove
# Ensure no Surư Apache packages remain
sudo apt-cache policy apache2 apache2-data
# Install Apache from Debian
sudo apt-get install apache2
[/code]
Back to top
MCFH



Joined: 03 Mar 2026
Posts: 5
Location: UK, London

PostPosted: Thu 05 Mar '26 20:21    Post subject: Reply with quote

Thank you for this We are making progress!!

I have now successfully removed apache and reinstalled it. So I can see a running webserver that is rendering PHP code as text.

I understand that to fix this I need to install and enable the relevant PHP module. But I note that /usr/lib/apache2/modules is missing mod_php7.4.so (which is the version of PHP I need if I do php -v). I think the installation package that contains that is
libapache2-mod-php7.4

I can see php7.4.conf and .load in /etc/apache2/mods-available

Code:
Package libapache2-mod-php7.4 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libapache2-mod-php7.4' has no installation candidate


Any ideas for next steps?
Thnk you
Back to top


Reply to topic   Topic: Apache Installation Issue View previous topic :: View next topic
Post new topic   Forum Index -> Apache