When i install apache2 on my localhost system it shows me this error (Ubuntu 17.10)

312 Views Asked by At

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.27-2ubuntu3) but 2.4.27-2ubuntu4.1 is to be installed

E: Unable to correct problems, you have held broken packages.

Thanks in Advance

2

There are 2 best solutions below

0
On BEST ANSWER

Maybe you should take a look at this article:
https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages

thomasrutter: "That particular error message may indicate that you have held packages, but it may also indicate a different problem."

He basically says to do some trouble shooting with some of these commands:

You are able to get a list of held packages with the following command

dpkg --get-selections | grep hold

If none show up or none of them seem related to you it might be something else.

Also have you tried aptitude instead of apt-get to install the package? I personally think that is a great place to start

sudo aptitude install <apache2 or whatever package you're trying to install>

And last but not least:

sudo aptitude -f install <packagename>


I myself struggled with apache for a while on ubuntu, I believe Thomas Rutter explained it a lot better so again I suggest you take a look at his answer on ask ubuntu

I hope this helped.

0
On

Run the following command and your problem will be solved.

apt-get purge apache2-bin