0

I have a freebsd system on which I usually manage ports with portmaster. As php55 was EOL'ed in July 2016, I upgraded php55 to php56 with portmaster -o /usr/ports/lang/php56 php5-5.5.24. Worked like a charm.

When updating ports later on (portmaster -a), I found that there are PHP helpers like archivers/php55-bz2 still around. Newer versions (e.g. archivers/php56-bz2) cannot be installed because they collide with the old ones and the old ones cannot be removed because the corresponding directories are no longer there.

How do I force-remove the old php55 helpers so I can install the new php56 versions?

patmin
  • 117
  • 1
  • 10

2 Answers2

0

Removing the old port via pkg_delete did not work ("package not installed"), with option -f only the DB entry was deleted, which still did not permit installation of the new package.

I finally had success deinstalling with pkg_deinstall. A half installed new package was uninstalled with make deinstall before installation with portmaster succeeded.

patmin
  • 117
  • 1
  • 10
0

To migrate from PHP 5.5 to 5.6, you'll have to manually apply portmaster -o to all php55-* packages. So, theorically, a command like this may work:

awk \
    -vPATTERN="55" \
    -vREPLACEMENT="56" \
    'BEGIN { while (("pkg query -x %o \"/(mod_)?php" PATTERN "(-|$)\"" | getline name) > 0) { oldname = name; sub(PATTERN, REPLACEMENT, name); print "portmaster -o " name " " oldname } }' | sh

But this might not be so easy in practice:

  • if you were upgrading from 5.X to 7.X, some packages need to be removed first (like pecl-intl or php56-mysql)
  • pecl-* packages may also need to be rebuilt (portmaster pecl?, if they are compatible - still related to ABI breaks between PHP 5 and 7)

This is why some users prefer to deinstall all old php packages (pkg delete -R php55\*) before reinstalling them in a new version.

julp
  • 3,860
  • 1
  • 22
  • 21