2
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
Zanna
  • 70,465

2 Answers2

5

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
pa4080
  • 29,831
1

Tasksel is a Debian/Ubuntu tool that installs multiple related packages as a co-ordinated "task" onto your system.

Installation:

sudo apt-get install tasksel

Usage:

sudo tasksel

The tasksel menu will be shown, select the checkbox you need type Space, Tab, Enter, wait… done.

Installation from terminal lamp-server (Apache/PHP/MySQL Server)

sudo tasksel install lamp-server

Optional for PHP:

sudo apt-get install php php-mysql php-mbstring php-all-dev php-cgi libapache2-mod-php php-imagick

PhpMyAdmin

sudo apt-get install phpmyadmin