upgrade of 6 to 7.1 with multiple perl installs

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

upgrade of 6 to 7.1 with multiple perl installs

Postby Golding » Dec 14th, '19, 20:54

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
Last edited by isadora on Dec 14th, '19, 21:24, edited 1 time in total.
Reason: Placed command-output in between [CODE]-tags for better readability ;)
Golding
 
Posts: 9
Joined: May 2nd, '14, 14:47

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby martinw » Dec 14th, '19, 21:35

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).
martinw
 
Posts: 609
Joined: May 14th, '11, 10:59

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby Golding » Dec 15th, '19, 03:42

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
Golding
 
Posts: 9
Joined: May 2nd, '14, 14:47

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby martinw » Dec 15th, '19, 11:25

I don't understand what you are asking. Which Perl RPMs need to be reconstructed, and why?
martinw
 
Posts: 609
Joined: May 14th, '11, 10:59

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby Golding » Dec 15th, '19, 16:33

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
Golding
 
Posts: 9
Joined: May 2nd, '14, 14:47

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby martinw » Dec 15th, '19, 17:50

https://perlmaven.com/how-to-change-inc ... -locations

But 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.
martinw
 
Posts: 609
Joined: May 14th, '11, 10:59

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby jiml8 » Dec 15th, '19, 22:47

Just a guess, but could be the OP is having the same problem I had: viewtopic.php?f=7&t=13165
jiml8
 
Posts: 1253
Joined: Jul 7th, '13, 18:09

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby martinw » Dec 15th, '19, 23:48

jiml8 wrote:Just a guess, but could be the OP is having the same problem I had: viewtopic.php?f=7&t=13165

I can't see any similarity.
martinw
 
Posts: 609
Joined: May 14th, '11, 10:59

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby Golding » Dec 16th, '19, 00:30

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
Golding
 
Posts: 9
Joined: May 2nd, '14, 14:47

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby jiml8 » Dec 16th, '19, 01:18

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.
jiml8
 
Posts: 1253
Joined: Jul 7th, '13, 18:09

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby martinw » Dec 18th, '19, 01:54

@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.
martinw
 
Posts: 609
Joined: May 14th, '11, 10:59

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby Golding » Dec 18th, '19, 03:47

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
Golding
 
Posts: 9
Joined: May 2nd, '14, 14:47

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby doktor5000 » Dec 18th, '19, 05:46

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'
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17630
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby Golding » Dec 18th, '19, 18:38

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
Last edited by isadora on Dec 18th, '19, 19:22, edited 1 time in total.
Reason: Placed command-output in between [CODE]-tags for better readability ;)
Golding
 
Posts: 9
Joined: May 2nd, '14, 14:47

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby martinw » Dec 19th, '19, 01:32

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?
martinw
 
Posts: 609
Joined: May 14th, '11, 10:59

Re: upgrade of 6 to 7.1 with multiple perl installs

Postby Golding » Dec 19th, '19, 01:50

Ok, I will try to get the Mageia perl source RPM and rebuild it.

Thanks, Brian
Golding
 
Posts: 9
Joined: May 2nd, '14, 14:47


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron