can't install apache2

November 14, 2019 487 views
Apache Ubuntu 16.04

I want to install SSL Certificate but I can’t install apache2.

when I type

sudo apt-get install apache2

Reading package lists… Done
Building dependency tree

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-bin (= 2.4.41-1+ubuntu16.04.1+deb.sury.org+5) but it is not installable
E: Unable to correct problems, you have held broken packages.

1 Answer

Hello @cloud474606,

Have you tried updating your system? You’ll need to

sudo apt-get update

Once it finishes, do

sudo apt-get upgrade

Then try to install Apache again. If it fails, you’ll need to go back to a state there all dependencies are satisfied:

 sudo apt-get install -f

Try to remove all Apache stuff:

sudo dpkg --purge --force-depends "apache*"

Reinstall now all necessary dependencies:

 sudo apt-get install -f

Now you can give the Apache installation a new try. If the problem persists, please provide more information.

Regards,
KDSys

  • Thank you for answer.

    I try to follow you

    sudo dpkg –purge –force-depends “apache2”
    dpkg: warning: ignoring request to remove apache2 which isn’t installed

    sudo apt-get install -f
    Reading package lists… Done
    Building dependency tree

    Reading state information… Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

    sudo apt-get install apache2
    Reading package lists… Done
    Building dependency tree

    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-bin (= 2.4.41-1+ubuntu16.04.1+deb.sury.org+5) but it is not installable
    E: Unable to correct problems, you have held broken packages.

    .
    .
    and I still can’t not install apache2

Have another answer? Share your knowledge.