E Package Apache2 Has No Installation Candidate Dashboard Rating: 4,5/5 4605 reviews

When i try to install php5 in Ubuntu 16.04 by using following code:

  1. Php5 Has No Installation Candidate

This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'libapache2-mod-fastcgi' has no installation candidate In order to add that package, download it and install it manually. How to Install ownCloud 10 on Ubuntu Debian and. Install Apache2. Package ‘php5’ has no installation candidate E: Package ‘php5-gd’ has no. Author:spylh9999ggr When I tried to install apache2 on Ubuntu 14.04, I got the following error message: root@Final-Gitsetup-Developers:~# apt-get install apache2 Reading package lists.

I get following error:

I have tried reinstalling but it does not help.

All this error was encountered after I updated my 15.10 Ubuntu to 16.04

Srijan KarkiSrijan Karki

7 Answers

Ubuntu 16.04 comes with PHP7 as the standard, so there are no PHP5 packages

However if you like you can add a PPA to get those packages anyways:

Remove all the stock php packages

Php5 Has No Installation Candidate

List installed php packages with dpkg -l grep php awk '{print $2}' tr 'n' ' ' then remove unneeded packages with sudo aptitude purge your_packages_here or if you want to directly remove them all use :

Add the PPA

Install your PHP Version

Has

You can install php5.6 modules too ..

Verify your version

Based on https://askubuntu.com/a/756186/532957 (thanks @AhmedJerbi)

Community
Rodrigo StadlerRodrigo Stadler
Package php5 has no installation candidate

You must use prefix 'php5.6-' instead of 'php5-' as in ubuntu 14.04 and olders:

Dong NguyenDong Nguyen

If you just want to install PHP no matter what version it is, try PHP7

Joe zhouJoe zhou
ErickyEricky

Currently, I am using Ubuntu 16.04 LTS.Me too was facing same problem while Fetching the Postgress Database values using Php so i resolved it by using the below commands.

Mine PHP version is 7.0, so i tried the below command.

apt-get install php-pgsql
Remember to restart Apache.

MD ShahrouqMD Shahrouq

I recently had this issue as well and solved it using the following command:

php is now installed. I'm using Ubuntu 18.04.

LeanneLeanne
xereonxereon

Not the answer you're looking for? Browse other questions tagged phpubuntuaptdpkgubuntu-16.04 or ask your own question.

Got error E: Package 'apache2' has no installation candidate while installing apache2 with sudo apt-get install apache2 on Ubuntu 17.10.Here is the message displayed on terminal.

Message after apt-cache policy apache2 command.

Message after egrep -v '^# ^ *$' /etc/apt/sources.list /etc/apt/sources.list.d/*.list command

How can I solve this issue?

Kiran Shahi
Kiran ShahiKiran Shahi

2 Answers

The main problem is missed /etc/apt/sources.list.You can recreate it with:

Then run

N0rbertN0rbert

Try sudo apt-get update and then sudo apt-get install apache2.I recommend installing the complete LAMP Stack using tasksel

sudo tasksel to launch itSelect LAMP server and install it.Hope that helps.

Pranal NarayanPranal Narayan

Not the answer you're looking for? Browse other questions tagged aptserverpackage-managementapache2 or ask your own question.