Your perl and your Config.pm seem to have different ideas about the architecture they are running on

124 Views Asked by At

I am trying to install a perl-based program using my system perl and local::lib. The program has several dependencies, which I want to install with apt, e.g., libalien-wxwidgets-perl, libwx-perl,libgraphics-gnuplotif-perl, etc. I have installed local::lib with cpan and added the line to my ~/.zshrc, but it seems that it's not working. When I run perl -I. Build.PL, it says I don't have permissions and I need to run sudo perl -I. Build.PL.

In this case, this is the error, but I will also get other permissions related errors. Since the directory is not below ~/perl5, I am thinking this is because local::lib isn't working:

Can't create '_build/runtime_params': Permission denied at /usr/local/share/perl/5.34.0/Module/Build/Notes.pm line 110.

Perl also cannot find these packages installed by apt. On a fresh system, with local::lib installed manually, perl -I. Build.PL works without sudo, and perl finds, for example, libwx-perl.

so I tried to install local::lib manually:

wget https://cpan.metacpan.org/authors/id/H/HA/HAARG/local-lib-2.000029.tar.gz
tar xvf local-lib-2.000029.tar.gz
cd local-lib-2.000029
perl Makefile.PL --bootstrap

but I get this error:

Have /usr/lib/x86_64-linux-gnu/perl-base
Want /usr/lib/x86_64-linux-gnu/perl/5.34
Your perl and your Config.pm seem to have different ideas about the
architecture they are running on.
Perl thinks: [perl-base]
Config says: [x86_64-linux-gnu-thread-multi]
This may or may not cause problems. Please check your installation of perl
if you have problems building this extension.
Generating a Unix-style Makefile
Writing Makefile for local::lib
Writing MYMETA.yml and MYMETA.json

I think this has something to do with why perl can't find the packages installed by apt and also why local::lib doesn't work. What does "Your perl and your Config.pm seem to have different ideas about the architecture they are running on" mean? Could this have to do with the fact that I upgraded from Ubuntu 20.04 to 22.04 (rather than doing a fresh reinstall)?

As per this question, I have deleted all PERL5LIB lines from my ~/.zshrc, but I still get the error.

Here is perl -V:

  %ENV:
    PERL5LIB="/home/joseph/perl5/lib/perl5"
    PERL_LOCAL_LIB_ROOT="/home/user/perl5"
    PERL_MB_OPT="--install_base "/home/user/perl5""
    PERL_MM_OPT="INSTALL_BASE=/home/user/perl5"
  @INC:
    /home/user/perl5/lib/perl5/5.34.0/x86_64-linux-gnu-thread-multi
    /home/user/perl5/lib/perl5/5.34.0
    /home/user/perl5/lib/perl5/x86_64-linux-gnu-thread-multi
    /home/user/perl5/lib/perl5
    /etc/perl
    /usr/local/lib/x86_64-linux-gnu/perl/5.34.0
    /usr/local/share/perl/5.34.0
    /usr/lib/x86_64-linux-gnu/perl5/5.34
    /usr/share/perl5
    /usr/lib/x86_64-linux-gnu/perl-base
    /usr/lib/x86_64-linux-gnu/perl/5.34
    /usr/share/perl/5.34
    /usr/local/lib/site_perl

I am trying to get it so that my system install of perl 5.34 can both run without sudo and can find the dependencies I've installed by apt.

0

There are 0 best solutions below