FreeBSD pkg_add: warning: package php5-pcre-5.2.6_2 requires php5-5.2.8, but php5-pcre-5.2.6_2 is installed

by Vivek Gite on December 22, 2008 · 1 comment

Q. I'm trying to upgrade my PHP version from 5.2.6 to 5.2.8 using portupgrade command. But I'm getting following errors:

*** Error code 1

Stop in /usr/ports/lang/php5.
*** Error code 1

Stop in /usr/ports/lang/php5.
*** Error code 1

Stop in /usr/ports/lang/php5.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade.42275.0 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=php5-pcre-5.2.6_2 UPGRADE_PORT_VER=5.2.6_2 make reinstall
---> Restoring the old version
pkg_add: warning: package 'php5-pcre-5.2.6_2' requires 'php5-5.2.8', but 'php5-pcre-5.2.6_2' is installed
** Fix the installation problem and try again.
[Updating the pkgdb
in /var/db/pkg ... - 62 packages found (-0 +1) . done]
** Listing the failed packages (-:ignored / *:skipped / !:failed)
! lang/php5 (php5-pcre-5.2.6_2) (install error)

How do I fix this problem and upgrade php5-pcre?

A. This is well known problem and can be fixed easily.

As of php 5.2.7, pcre extension is distributed with the core php5 package, and not as a standalone module anymore. Follow these steps to update your installation:

# pkg_delete -f php5-pcre-5.2.6
# pkgdb -F
# portupgrade php5-pcre

If you are using portmaster, enter:
# pkg_delete -f php5-pcre\*
# portmaster php5\*

If you are using pecl ports you might need to force an update on them, enter:
# portupgrade -f pecl\*
OR
# portmaster pecl\*

If you have the pecl hash, json and/or zip extensions you need to replace them with the php5 bundled ones, enter
# portupgrade -o archivers/php5-zip archivers/pecl-zip
# portupgrade -o devel/php5-json devel/pecl-json
# portupgrade -o security/php5-hash security/pecl-hash

OR
# portmaster -o archivers/php5-zip archivers/pecl-zip
# portmaster -o devel/php5-json devel/pecl-json
# portmaster -o security/php5-hash security/pecl-hash

Finally ,build your INDEX locally and you tried to build it after the php update commit, you need to rebuild it after you updated lang/php5:
# cd /usr/ports
# make index

References

  1. man page make, portmaster, portupgrade, /usr/ports/UPDATING

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 1 comment… read it below or add one }

1 Meskalyn February 23, 2009

After a night of googling, I found my answer on your blog…

Thanks for all this good BSD stuff you publish…

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 7 + 3 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: