7

On a FreeBSD system, instructions say to rebuild all p5-* ports - how do I do that?

A bit of background... I'm an experienced Linux person, trialling (and liking) the latest PC-BSD (PCBSD9.2-RELEASE-x64). I've previously installed simple packages and ports ok, I thought I would try some more exotic - mono and F#:

cd /usr/ports/lang/mono && make install clean BATCH=yes && \ 
cd /usr/ports/lang/fsharp && make install clean BATCH=yes

I got this error output:

configure: error: perl module Locale::gettext required
===>  Script "configure" failed unexpectedly.
Please read UPDATING entry 20130612
(http://svnweb.freebsd.org/ports/head/UPDATING?r1=320405&r2=32067) and
PR/184276 (http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/184276) to fix
your Perl installation if you got the error message "configure: error: perl
module Locale::gettext required".

The first link doesn't work (why not?) but the second link (http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/184276) explains that "the directory structure where Perl is installed has also been modified .... [as] a result of the 20130612 layout change" and that the fix is to:

rebuild all p5-* ports

I presume all p5-* ports means all Perl 5 ports. How do I find what Perl 5 ports I have installed? And rebuild all of them?

Sonia Hamilton
  • 341
  • 1
  • 4
  • 11

2 Answers2

8

Generally, you can consult the contents of the /usr/ports/UPDATING file on how to deal non-trivial upgrades. Usually, it provides solutions for users that are using portupgrade, portmaster or binary pkgng packages.

Here are the instructions from the 20130612 entry in the UPDATING file:

 ...
 Please rebuild all Perl ports and all ports that depend on it:

 # portmaster -r perl
   or
 # portupgrade -rf perl
   or
 # pkg install -fR perl

The first instruction is for systems using the ports-mgmt/portmaster port, the second is for systems using the ports-mgmt/portupgrade port and the third one is for systems using binary pkgng packages.

I am afraid that if you wanted to avoid installing a port manager/helper tool you'd have a more difficult job because you'll have to go through every single Perl 5 port manually and run make deinstall && make reinstall.

user76776
  • 436
  • 2
  • 4
  • Thanks user76776 for pointing out UPDATING. I'll have to RTFM on the differences between portmaster/portupgrade/pkgng - still BSD n00b. Commands 2 & 3 didn't solve problem (fsharp install), and command 1 failed (command not found) as I haven't installed portmaster (yet). – Sonia Hamilton Dec 05 '13 at 00:53
  • There is a section in the handbook explaining how to use the portmaster/portupgrade tools with ports: https://www.freebsd.org/doc/handbook/ports-using.html. Keep in mind that you shouldn't use both portmaster and portupgrade at the same time (though it is possible with some extra work). Given that you are using pcbsd, you can install mono and fsharp from the package manager without any manual compilation. Running `sudo pkg install fsharp` should take care of the dependencies for you too. You can get more info about pkgng at http://www.freebsd.org/doc/handbook/pkgng-intro.html. – user76776 Dec 05 '13 at 08:52
  • Thanks `sudo pkg install fsharp` "just worked". Now I need to study up on ports/portmaster/portupgrade/etc for future installs... – Sonia Hamilton Dec 05 '13 at 23:20
5

Try portupgrade -f /var/db/pkg/p5*. This will rebuild all your installed p5* ports.

portupgrade is not part of the base system. You can find this port in ports-mgmt/portupgrade.

Vinz
  • 712
  • 4
  • 13
  • 1
    +1 Also `pkg_add -r portupgrade` is a quick way to install that package. – Chris S Dec 04 '13 at 23:19
  • @sonia-hamilton : if the packages don't exist in that directory, then you can use `pkg_info | grep '^p5'` to list your installed `p5*` packages. Now you know which `p5*` ports you have to recompile. If there's no `p5*` packages installed, you have nothing more to do. – Vinz Dec 05 '13 at 00:58