# perl5 update error



## Reken (Aug 25, 2020)

I have FreeBSD 11.3 and perl5.26
I want to update perl5.26 to perl5.32

Added to make.conf:

```
DEFAULT_VERSION+= perl5.32
```

I run the command : portupgrade -o lang/perl5.32 -f lang/perl5.26

OUTPUT

```
root@unix:~ # portupgrade -o lang/perl5.32 -f lang/perl5.26
[Reading data from pkg(8) ... - 240 packages found - done]
--->  Upgrading 'perl5-5.26.3' to 'perl5-5.32.0' (lang/perl5.32)

--->  Building '/usr/ports/lang/perl5.32' with make flags: -DDISABLE_CONFLICTS
===>  Cleaning for perl5-5.32.0
===>  License ART10 GPLv1+ accepted by the user
===>   perl5-5.32.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by perl5-5.32.0 for building
===>  Extracting for perl5-5.32.0
=> SHA256 Checksum OK for perl/perl-5.32.0.tar.xz.
/bin/ln -s libperl.so.5.32.0 /usr/ports/lang/perl5.32/work/perl-5.32.0/libperl.so
/bin/ln -s libperl.so.5.32.0 /usr/ports/lang/perl5.32/work/perl-5.32.0/libperl.so.5.32
===>  Patching for perl5-5.32.0
===>  Applying FreeBSD patches for perl5-5.32.0 from /usr/ports/lang/perl5.32/files
/usr/bin/sed -i.bak -e 's|/usr/local|/usr/local|g'  /usr/ports/lang/perl5.32/work/perl-5.32.0/Configure /usr/ports/lang/perl5.32/work/perl-5.32.0/hints/freebsd.sh

===>  Configuring for perl5-5.32.0
First let's make sure your kit is complete.  Checking...
Locating common programs...
Checking compatibility between /bin/echo and builtin echo (if any)...
Symbolic links are supported.
Checking how to test for symbolic links...
You can test for symbolic links with 'test -h'.
Checking for cross-compile
No targethost for running compiler tests against defined, running locally
Good, your tr supports [:lower:] and [:upper:] to convert case.
Using [:upper:] and [:lower:] to convert case.

aix                     greenhills              os400
aix_3                   haiku                   posix-bc
aix_4                   hpux                    qnx
altos486                i386                    riscos
amigaos                 interix                 sco
atheos                  irix_4                  sco_2_3_0
aux_3                   irix_5                  sco_2_3_1
bitrig                  irix_6                  sco_2_3_2
bsdos                   irix_6_0                sco_2_3_3
catamount               irix_6_1                sco_2_3_4
convexos                isc                     solaris_2
cxux                    isc_2                   stellar
cygwin                  linux-android           sunos_4_0
darwin                  linux                   sunos_4_1
dcosx                   lynxos                  super-ux
dec_osf                 midnightbsd             svr4
dos_djgpp               minix                   svr5
dragonfly               mips                    ti1500
dynix                   mirbsd                  ultrix_4
dynixptx                mpc                     umips
epix                    ncr_tower               unicos
esix4                   netbsd                  unicosmk
fps                     newsos4                 unisysdynix
freebsd                 nonstopux               utekv
freemint                openbsd                 uwin
gnu                     opus                    vos
gnukfreebsd             os2
gnuknetbsd              os390

Which of these apply, if any? [freebsd]

Some users have reported that Configure halts when testing for
the O_NONBLOCK symbol with a syntax error.  This is apparently a
sh error.  Rerunning Configure with ksh apparently fixes the

problem.  Try
        ksh Configure [your options]

Operating system name? [freebsd]
Operating system version? [11.3-release]
Installation prefix to use? (~name ok) [/usr/local]
AFS does not seem to be running...
What installation prefix should I use for installing files? (~name ok)
[/usr/local]
Getting the current patchlevel...
Build a threading Perl? [y]

Use which C compiler? [cc]
Checking for GNU cc in disguise and/or its version number...
Now, how can we feed standard input to your C preprocessor...
Directories to use for library searches?
[/usr/lib /usr/local/lib /usr/lib/clang/8.0.0/lib /usr/lib]
What is the file extension used for shared libraries? [so]
Make shared library basenames unique? [n]
Build Perl for SOCKS? [n]
Try to use long doubles if available? [n]
Checking for optional libraries...
What libraries to use? [-lpthread -lgdbm -lm -lcrypt -lutil]
What optimizer/debugger flag should be used?
[-O2 -pipe -fstack-protector-strong -fno-strict-aliasing ]

Any additional cc flags?
[-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include]
Let me guess what the preprocessor flags are...
Any additional ld flags (NOT including libraries)?
[-pthread -Wl,-E  -fstack-protector-strong -L/usr/local/lib]
Checking your choice of C compiler and flags for coherency...
I've tried to compile and run the following simple program:

#include <stdio.h>
int main() { printf("Ok\n"); return(0); }

I used the command:

        cc -o try -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -pthread -Wl,-E -fstack-protector-strong -L/usr/local/lib try.c -lpthread -lgdbm -lm -lcrypt -lutil
         ./try

and I got the following output:

Shared object "libgdbm.so.4" not found, required by "try"
The program compiled OK, but exited with status 1.
You have a problem.  Shall I abort Configure [y]
Ok.  Stopping Configure.

===>  Script "Configure" failed unexpectedly.
Please report the problem to mat@FreeBSD.org [maintainer] and attach the
"/usr/ports/lang/perl5.32/work/perl-5.32.0/config.log" including the output
of the failure of your make command. Also, it might be a good idea to provide
an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/perl5.32
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/perl5.32
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20200825-2906-19amown env UPGRADE_TOOL=portupgrade UPGRADE_PORT=perl5-5.26.3 UPGRADE_PORT_VER=5.26.3 make -DDISABLE_CONFLICTS
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! lang/perl5.32 (perl5-5.26.3)  (unknown build error)
root@unix:~ #
```

How to fix the problem?


----------



## SirDice (Aug 25, 2020)

Perl 5.32 is the default, no need to explicitly set it. And I suggest you upgrade to 11.4 first, 11.3 will be EoL soon. Then use packages to update everything.


----------



## Reken (Aug 25, 2020)

initially I installed everything from ports
If I update with packages now, I break the system ...

What else do you say? Upgrading to 11.4 won't solve my problem ...


----------



## SirDice (Aug 25, 2020)

Reken said:


> initially I installed everything from ports


Did you use any non-default options? If not then you're not gaining anything by building from ports.


Reken said:


> If I update with packages now, I break the system ...


Why do you think that?


----------



## VladiBG (Aug 25, 2020)

You have GDBM selected in your configuration of perl and you are missing the databases/gdbm or it's old verision.

You have 2 options
To install/update databases/gdbm
or
remove GDBM file extension from your perl5.32 config by navigating to /usr/ports/lang/perl5.32 and then `make config`

To upgrade from perl5.26 to perl5.32

Edit your /etc/make.conf and add
`DEFAULT_VERSIONS+= perl5=5.32`

Replace the current installed version of 5.26 with 5.32
`portugprade -o lang/perl5.32 -f lang/perl5.26`

Rebuild all ports which depend of old version 5.26 using
`portupgrade -f `pkg shlib -qR libperl.so.5.26``

Other method is to uninstall manually perl5.26 then install 5.32 and rebuild all ports that are still depending on libperl.so.5.26

If you are using portmaster read /usr/ports/UPDATING #20161103

Edit:
You have /etc/make.conf wrong!
DEFAULT_VERSIONS+= perl5=5.32


----------



## SirDice (Aug 25, 2020)

There is no need to set the Perl version in make.conf, Perl 5.32 is already the default Perl version. There's no need to set this explicitly. Only set DEFAULT_VERSIONS if you want to _deviate_ from the defaults.

Read /usr/ports/UPDATING and follow the instructions there.

```
20200803:
 	  AFFECTS: users of lang/perl5*
 	  AUTHOR: mat@FreeBSD.org
 	
 	  The default Perl version has been switched to Perl 5.32.  If you are using
 	  binary packages to upgrade your system, you do not have anything to do, pkg
 	  upgrade will do the right thing.  For the other people, follow the
 	  instructions in entry 20161103, it should still be the same.
```


----------



## T-Daemon (Aug 25, 2020)

SirDice said:


> There is no need to set the Perl version in make.conf, Perl 5.23 is already the default Perl version. There's no need to set this explicitly. Only set DEFAULT_VERSIONS if you want to _deviate_ from the defaults.



Besides that the override variable should be defined as, e.g., `DEFAULT_VERSIONS+= perl5=5.32`_. _See /usr/ports/Mk/bsd.default-versions.mk.



Reken said:


> DEFAULT_VERSION+= perl5.32





VladiBG said:


> DEFAULT_VERSION+= perl5.32


----------



## VladiBG (Aug 25, 2020)

Yes i fixed my post it should be DEFAULT_VERSIONS+= perl5=5.32


----------



## Reken (Aug 26, 2020)

I did the following: 

```
# make -C /usr/ports/lang/perl5.32 showconfig | grep -i gdbm
GDBM=off: GDBM_File extension
#/usr/ports/databases/gdbm# make reinstall clean
```

Thereafter

```
portupgrade -o lang/perl5.32 -f lang/perl5.26
Command completed successfully
```


```
portupgrade -f `pkg shlib -qR libperl.so.5.26
I see an error:
Installing perl5-5.32.0...
pkg-static: perl5-5.32.0 conflicts with perl5.32-5.32.0 (installs files into the same place).  Problematic file: /usr/local/bin/perl5.32.0
*** Error code 70

Stop.
make[2]: stopped in /usr/ports/lang/perl5.32
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/perl5.32
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/p5-Params-Util
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20200826-918-td4hcw env UPGRADE_TOOL=portupgrade UPGRADE_PORT=p5-Params-Util-1.07_2 UPGRADE_PORT_VER=1.07_2 make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! devel/p5-Locale-gettext (p5-Locale-gettext-1.07)      (unknown build error)
        ! devel/p5-Variable-Magic (p5-Variable-Magic-0.62)      (unknown build error)
        ! devel/p5-Locale-libintl (p5-Locale-libintl-1.31)      (unknown build error)
        ! databases/p5-DBI (p5-DBI-1.642)       (unknown build error)
        ! devel/p5-Sub-Identify (p5-Sub-Identify-0.14)  (unknown build error)
        ! devel/p5-Package-Stash-XS (p5-Package-Stash-XS-0.29)  (unknown build error)
        ! devel/p5-Params-Util (p5-Params-Util-1.07_2)  (unknown build error)
root@unix:~ #
```

P.S.
Practice shows if the program was originally compiled from ports. Upgrading without using portupgrade or portmaster may break the program. My personal experience


----------



## VladiBG (Aug 26, 2020)

You are missing the closing single quote
portupgrade -f `pkg shlib -qR libperl.so.5.26  <--- missing " ` "
should be
`portupgrade -f `pkg shlib -qR libperl.so.5.26``


----------



## Reken (Aug 26, 2020)

I made a typo on the forum
In the console, I enter the command correctly
All the time I see the error indicated above on the forum ...


----------



## VladiBG (Aug 26, 2020)

What is the output of:
`pkg shlib -qR libperl.so.5.26`
`pkg ver | grep perl`


----------

