Unable to locate package php5-dev

I need to install some packages to prepare the workspace for a project in the Debian 9 OS runs in a VB. I have the instruction:

----------------------------------------------------------------------
The following Debian 8 packages are required to run [X-Product]:

sudo apt-get install exim4 ntp pwgen curl php5-dev php-pear pkg-config nmap libzmq3 libzmq3-dev libapache2-mod-php5 apache2 percona-server-server-5.6 php5-cli php5-mysql php5-curl php5-intl daemontools-run oracle-java8-installer ant ruby-compass libtool-bin
----------------------------------------------------------------------

When I run the command, I get the following terminal stack,

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php5-cli 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

Package php5-mysql 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

Package php5-curl 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

Package libapache2-mod-php5 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: Unable to locate package php5-dev
E: Unable to locate package libzmq3
E: Package 'libapache2-mod-php5' has no installation candidate
E: Package 'php5-cli' has no installation candidate
E: Package 'php5-mysql' has no installation candidate
E: Package 'php5-curl' has no installation candidate
E: Unable to locate package php5-intl

I did some research on the internet, did the following at next,

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

It doesn't help me at all. What do I need to fix this? I have very little knowledge about Debian if you ask

Note: I followed the instructions in the answer provided, the issue is still not solved like I cant see the php version

When I run the command of sudo apt-get install php5.6

It prints in the terminal,

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'php5.6-json' for regex 'php5.6'
Note, selecting 'php5.6-common' for regex 'php5.6'
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

To look for the PHP version,

sudo php -v

It prints in the terminal,

sudo: php: command not found

More info like if I run it

sudo apt-get install php5-dev I get error E: Unable to locate package php5-dev

But, the command sudo apt-get install php-dev is successful

The command dpkg -l | grep php| awk '{print $2}' |tr "\n" " " returns value,

Is that mean I hvae php7 installed and that blocks other operations?

dh-php php-cli php-common php-dev php-gd php-pear php-xml php7.0-cli php7.0-common php7.0-dev php7.0-gd php7.0-json php7.0-opcache php7.0-readline php7.0-xml pkg-php-tools

I am unable to install php5-dev package in ubuntu 12.10. I am getting the following on sudo apt-get install php5-dev:

 Reading package lists... Done
 Building dependency tree       
 Reading state information... Done
 E: Unable to locate package php5-dev

asked Jun 5, 2013 at 9:09

I just tried installing php5-dev package in Ubuntu 12.10, and I didn't have any problems. It installed fine.

Unable to locate package php5-dev

I'm including images of my software sources, just so you can compare with yours.

Unable to locate package php5-dev
Unable to locate package php5-dev

I also suggest the you just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below prior to installing:

sudo apt-get update && sudo apt-get upgrade

answered Jun 5, 2013 at 9:41

MitchMitch

104k23 gold badges205 silver badges265 bronze badges

1

I got a similar error when installing PHP or any other software. I changed the update server and then it started working.

So, please try to change the update server if you get a similar error.

You can change the update server you are using by going to System Settings > Software & updates, and then change the "Download from" line to another server.

jkt123

3,32021 silver badges24 bronze badges

answered Apr 29, 2014 at 14:18