How can i get rid of "apache2 : Depends: perl but it is not going to be installed" in ubuntu 14.04 desktop?

September 21, 2016 1.6k views
Apache Applications Ubuntu

This is the error message i have at console when running "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: perl but it is not going to be installed
Depends: apache2-bin (= 2.4.7-1ubuntu4) but it is not going to be installed
Depends: apache2-data (= 2.4.7-1ubuntu4) but 2.4.7-1ubuntu4.13 is to be installed
E: Unable to correct problems, you have held broken packages.

Output of update
$sudo apt-get update
Hit http://ppa.launchpad.net trusty InRelease
Ign http://in.archive.ubuntu.com trusty InRelease
Hit http://in.archive.ubuntu.com trusty Release.gpg
Hit http://ppa.launchpad.net trusty/main amd64 Packages
Hit http://in.archive.ubuntu.com trusty Release
Hit http://ppa.launchpad.net trusty/main i386 Packages
Hit http://ppa.launchpad.net trusty/main Translation-en
Hit http://in.archive.ubuntu.com trusty/main amd64 Packages
Hit http://in.archive.ubuntu.com trusty/main i386 Packages
Hit http://in.archive.ubuntu.com trusty/main Translation-en
Ign http://in.archive.ubuntu.com trusty/main Translation-en_IN
Reading package lists... Done

I have done recently
sudo rm -rf /var/lib/apt/lists/*
sudo rm /etc/apt/sources.list

Later i gone to
sudo -i software-properties-gtk

and checked the canonical checkbox then,

sudo apt-get update this command i executed.

can any one help me to install apache in my ubuntu!

1 Answer

You can try to fix all broken/missing packages by:

  • sudo apt-get install -f

Also you can try:

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get dist-upgrade
  • sudo apt-get autoremove
  • sudo apt-get clean

This will update your system, remove unused packages, and clean out local repository of retrieved package files.

After you do it, try installing apache again:

  • sudo apt-get install -y apache2

Good luck

Have another answer? Share your knowledge.