I need to install apache2 on my ubuntu system. On running the command:
sudo apt-get install apache2
I get this error:
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 : PreDepends: dpkg (>= 1.17.14)
E: Unable to correct problems, you have held broken packages.
I checked out other similar questions and tried to do this:
sudo apt-get install -f
sudo dpkg --purge --force-depends "apache*"
sudo apt-get install apache2
But the second command says:
sudo dpkg --purge --force-depends "apache*"
dpkg: error: --purge needs a valid package name but 'apache*' is not: illegal package name in specifier 'apache*': character `*' not allowed (only letters, digits and characters `-+._')
I surfed more and some people say this might be due to php7 installed. I don't understand why that would be so and can't resolve this error. Please help
EDIT: Output of lsb_release -a; uname -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
Linux myprecious 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I have that candidate and one more latest one:
2.4.12-2 0 500 ppa.launchpad.net/cybersec/chaos-ppa-v2/ubuntu trusty/main amd64 Packages
sudo apt-get purge apache2; sudo apt-get autoremove
lsb_release -a; uname -a
apt-cache policy apache2
apache2
package that has dependencies your system can't meet. Useapt-cache policy apache2
to see which version ofapache2
from which repository you're trying to install. On 14.04, it should be something containingCandidate: 2.4.7-1ubuntu4.9
and500 http://de.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
.