"sudo apt-get install php7.0-dev" not working
Solution 1
php7.0-dev is not in the trusty repositories (see here), so it stands to reason that some/many of its dependencies won't be in that repository, either.
Easy answer
Upgrade to 16.04 LTS xenial when it is officially released next week April 21, 2016. It has php7.0-dev and all of its dependencies. See here.
Hard answer
You may be able to manually install the dependent packages. If you go to http://packages.ubuntu.com/xenial/php7.0-dev and download each package manually, then install them either using the Software Center or dpkg -i
.
I've had mixed success with this process. There's a reasonably chance that you may run into a package that needs a newer core library (e.g. libc6).
Good luck!
Solution 2
I upgraded ubuntu from 14.04 to 16.06.
I had to disable php 5.6 with sudo a2dismod php5.6 and enabled php 7.0 sudo a2enmod php7.0.
The I started receiving the same error message while installing php7.0-dev
This worked fine for me.
sudo apt install libpcre3=2:8.38-3.1 libpcre3-dev=2:8.38-3.1 and then sudo apt-get install php7.0-dev
Related videos on Youtube
Guerrilla
Updated on September 18, 2022Comments
-
Guerrilla over 1 year
I am trying to install Xdebug to server and pre-requisite in tutorial I am following is php5-dev but I am using php7.0.5 so I tried
sudo apt-get install php7.0-dev
.It gives me
Reading package lists... Done Building dependency tree Reading state information... Done 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: php7.0-dev : Depends: libpcre3-dev but it is not going to be installed E: Unable to correct problems, you have held broken packages.
I tied to install libpcre3 and got a similar message about another package. I don't know what I am doing here so not sure what to do.
Server is Ubuntu 14.04, Nginx 1.9.13, PHP7.0-FPM.
Any advice on what to do to install php dev?
-
nit17 about 8 yearsHow did you get php7.0-fpm on this server in the first place?
-
-
Elzo Valugi over 7 yearsas per today 16.04 still does not have it in the trusted repos
-
nit17 over 7 years@ElzoValugi What do you get if you call
apt search php7.0-dev
? I see that package in the list. -
Elzo Valugi over 7 years
php-all-dev/xenial,xenial 1:35ubuntu6 all package depending on all supported PHP development packages php7.0-dev/xenial-updates,xenial-security 7.0.8-0ubuntu0.16.04.3 amd64 Files for PHP7.0 module development
-
Elzo Valugi over 7 yearsit does not help, the result is the same.
-
nit17 over 7 years@ElzoValugi Well, according to the output of the first command, the package exists and is ready to be installed. But libpcre3-dev is a dependency, so you need to work out why it won't let you install libpcre3-dev. My guess is that something is out of sync or there's a misconfiguration that's stopping it from being installed. Did
apt-f install
complete the previous installation or did it have the same output? Have you doneapt-get upgrade
also to make sure everything's up to date? -
Elzo Valugi over 7 years
apt -f install
does not produce any special output,apt-get upgrade
has a notice, but I am not sure if is relevant :Calculating upgrade... Done The following packages have been kept back: liboxideqt-qmlplugin liboxideqtcore0 liboxideqtquick0 mysql-server-5.7 mysql-server-core-5.7 oxideqt-codecs-extra
-
Elzo Valugi over 7 yearsLet us continue this discussion in chat.