Ubuntu – Trying to install apache, but it says “package apache2 is not available”

Apache2php7software installation

sudo apt install apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package apache2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'apache2' has no installation candidate

Best Answer

The most installation manuals recommends the good practice to update the repository and upgrade the existing packages before install a new one. So try:

sudo apt update && sudo apt upgrade 
sudo apt install apache2
Related Question