Page 1 of 1
upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 14th, '19, 20:54
by Golding
In upgrading from 6 to 7.1 mageia installed the new version of perl in /usr/bin/perl but in addition to the perl libraries in /usr/lib64/perl5, it linked the libraries of the new perl to those in /usr/local/lib64/perl5 which is mounted from a different server and uses an older version of perl.
As a result none of the system utilities such as urpmi will work because they complain about incompatible libraries. For example,
- Code: Select all
% urpmi --help
/usr/bin/perl: symbol lookup error: /usr/local/lib64/perl5/auto/List/Util/Util.so: undefined symbol: Perl_Istack_sp_ptr
There are many perl rpm's installed. Is there a way to rebuild them all with the proper libraries in /usr/lib64/perl5 without doing a fresh install (there are too many local dependancies and things set up for the existing cluster for me to want to do a 'from scratch' install).
Brian
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 14th, '19, 21:35
by martinw
In Mageia 7, the system perl libraries have moved to /usr/share/perl5. In a fresh install /usr/lib64/perl5 doesn't exist. In an upgrade I would expect /usr/lib64/perl5 to have been deleted unless you had installed some non-Mageia packages (or unless you still have some Mageia 6 packages that haven't been replaced).
Your problem is that the standard Perl search path lists /usr/local/lib64/perl5 first. Run
- Code: Select all
perl -e "print qq(@INC)"
to see that. If you want an alternative version of Perl installed on your system, you will need to look into changing the default search paths to manage that, or move the alternative version somewhere else (/opt might be a good place).
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 15th, '19, 03:42
by Golding
Yes, I can move /usr/local/ aside, but there are many perl rpm's and they would have to be reconstructed in a particular order.
Can it be done with a single command.
Brian
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 15th, '19, 11:25
by martinw
I don't understand what you are asking. Which Perl RPMs need to be reconstructed, and why?
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 15th, '19, 16:33
by Golding
ok, perhaps I am overthinking. While I could move /usr/local/ aside momentarily to rebuild things, it would have to be put back again.
So is it perhaps possible to change @INC so that perl never looks in /usr/local/ (assuming that any code that has been already build will not go back to /usr/local).
Brian
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 15th, '19, 17:50
by martinw
https://perlmaven.com/how-to-change-inc ... -locationsBut what are you rebuilding? Most Perl applications, including all the Mageia tools, are not pre-compiled - they are scripts that are run by the Perl interpreter.
Also, do you really need two different versions of Perl? Perl is generally quite good on backwards compatibility.
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 15th, '19, 22:47
by jiml8
Just a guess, but could be the OP is having the same problem I had:
viewtopic.php?f=7&t=13165
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 15th, '19, 23:48
by martinw
I can't see any similarity.
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 16th, '19, 00:30
by Golding
My understanding is that @INC is hard encoded into the perl binary. Hence I could momentarily move /usr/local aside and try to rebuild perl ... as in ...
download the perl 28 source code
perl Makefile.PL
make
make test
sudo make install
or using just the rpm, I think that there is 'rpm --reinstall' that might work with the perl base rpm. Would that work?
What about all the other perl rpm's?
Brian
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 16th, '19, 01:18
by jiml8
I can't see any similarity.
My first attempt at upgrading failed with perl faults, where it clearly was getting confused about what libraries to use. This thread is titled: "upgrade of 6 to 7.1..." and the OP is talking about perl installs.
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 18th, '19, 01:54
by martinw
@Jim, Brian has intentionally mounted incompatible Perl libraries from another system in /usr/local. Your problem arose from an aborted upgrade attempt.
@Brian, I get the impression this is a classic
XY problem. If you could explain why you want/need two incompatible versions of Perl, I might be able to give better advice.
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 18th, '19, 03:47
by Golding
The machine I upgraded from 6 to 7.1 is a computer attached to a much larger cluster.
The larger cluster runs Centos which is constantly behind and running old versions of perl, gcc, etc but has a large collection of specific applications in /usr/local (big disks, large of memory). On the smaller machine (actually a number of machines) /usr/local and /home are mounted from the larger cluster. The smaller machines provide extra CPU power, graphical consoles, and more modern programs. I also prefer Mageia to Centos and like KDE. I had to upgrade from 6 to 7.1 for reasons of security, with 6 no longer being supported.
Currently the machines have been upgraded to 7.1 successfully and the perl has been upgraded to 7.1 (perl.28) but it uses @INC pointing to /usr/local and hence anything perl in mageia 7.1 fails to run and complains about incompatible libraries.
So I can momentarily move /usr/local aside, and either rebuild perl or possibly (?) 'rpm --reinstall perl-base-5.28.2-1.mga7' and then move back /usr/local. I am hoping that this would rebuild the perl binary with it's built in @INC. I would rather not install mageia 7.1 from scratch because there are lots of things that connect the machine to the cluster and to the specific uses on the local machine (so lots of work would be involved in that).
I have not rebuilt perl from scratch in either way and am worried I am more likely to break more things rather than fix things. For example, there are 149 other rpm's with perl in the title; would all of them need to be reinstalled?
Hope that this clarifies.
Brian
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 18th, '19, 05:46
by doktor5000
Dumb question, have you maybe defined PERLLIB or PERL5LIB in any shell startup files or similar ? From what I understand that would also move that path at the beginning of @INC - maybe that's what happens with /usr/local.
Can you maybe post the output of
- Code: Select all
perl -e 'print join "\n",@INC'
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 18th, '19, 18:38
by Golding
The report from perl is such that @INC looks first in /usr/local.
Yes, there is a startup file (somewhere) that mounts /usr/local and /home (ultimately I still want these to be mounted).
I have reset PERL5LIB as a user after boot but then, many icons e.g. mageia control center don't work. I have also changed code within individual programs editing them to add "use lib '/usr/lib64/perl5';" and then they appear to work. But there are many programs to reset. I do not know how to set PERL5LIB globally at startup before any perl program is run by the operating system and such that all users on the machine would get this setting, despite PERL still using @INC.
The output for @INC is ...
- Code: Select all
perl -e 'print join "\n",@INC'
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
/usr/lib/perl5/5.26.2
/usr/lib/perl5/5.26.1/x86_64-linux-thread-multi
/usr/lib/perl5/5.26.1
/usr/lib/perl5/5.26.1/x86_64-linux-thread-multi
/usr/lib/perl5/5.26.0
/usr/lib/perl5/5.26.0/x86_64-linux-thread-multi
/usr/lib/perl5/5.22.3/x86_64-linux-thread-multi
/usr/lib/perl5/5.22.3
/usr/lib/perl5/5.22.3/x86_64-linux-thread-multi
/usr/lib/perl5/5.22.2
/usr/lib/perl5/5.22.2/x86_64-linux-thread-multi
/usr/lib/perl5/5.22.1
/usr/lib/perl5/5.22.1/x86_64-linux-thread-multi
/usr/lib/perl5/5.22.0
/usr/lib/perl5/5.22.0/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.26.2
/usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.26.1
/usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.26.0
/usr/lib/perl5/vendor_perl/5.26.0/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.22.3/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.22.3
/usr/lib/perl5/vendor_perl/5.22.3/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.22.2/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.22.2
/usr/lib/perl5/vendor_perl/5.22.2/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.22.1
/usr/lib/perl5/vendor_perl/5.22.1/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.22.0
/usr/lib/perl5/vendor_perl/5.22.0/x86_64-linux-thread-multi
Thanks, Brian
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 19th, '19, 01:32
by martinw
If you were going to rebuild perl to change the default @INC, the best way would be to rebuild the perl package from the Mageia source RPM. The paths that make up @INC are defined in the RPM spec file. But you'd need to redo that any time the perl package got updated.
But is there a reason why you can't mount your CentOS filesystem somewhere other than /usr/local?
Re: upgrade of 6 to 7.1 with multiple perl installs

Posted:
Dec 19th, '19, 01:50
by Golding
Ok, I will try to get the Mageia perl source RPM and rebuild it.
Thanks, Brian