Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install Apache2

Trying to install apache2 on ubuntu 14.04, but gives following error

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.7-1ubuntu4.6) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
like image 285
Tanu Mittal Avatar asked Dec 05 '22 20:12

Tanu Mittal


2 Answers

Looks like some packages are broken in your system, first fix them

dpkg --configure -a
sudo apt-get -f install

then

sudo apt-get install apache2-bin apache2
OR
sudo aptitude install apache2-bin apache2 

This should fix your issue.

like image 165
Juned Avatar answered Dec 08 '22 11:12

Juned


sudo apt-get remove apache* && sudo apt-get install apache2
like image 24
acgbox Avatar answered Dec 08 '22 09:12

acgbox