Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't locate local/lib.pm in @INC : Installation of App::cpanminus fails on Windows 11, WSL with Ubuntu 20.04 #156

Open
hakonhagland opened this issue Apr 2, 2022 · 2 comments

Comments

@hakonhagland
Copy link

hakonhagland commented Apr 2, 2022

I am on Windows 11 in WSL terminal for Ubuntu 20.04.

$ perl --version | head -1
This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-gnu-thread-multi

$ which perl
/usr/bin/perl

$ cpan App::cpanminus
Loading internal logger. Log::Log4perl recommended for better logging

CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.

Would you like to configure as much as possible automatically? [yes]
Use of uninitialized value $what in concatenation (.) or string at /usr/share/perl/5.30/App/Cpan.pm line 679, <STDIN> line 1.

Warning: You do not have write permission for Perl library directories.

To install modules, you need to configure a local Perl library directory or
escalate your privileges.  CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use 'sudo' (if available).  You may also
resolve this problem manually if you need to customize your setup.

What approach do you want?  (Choose 'local::lib', 'sudo' or 'manual')
 [local::lib]
Attempting to create directory /home/hakon/perl5
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for local::lib
Writing MYMETA.yml and MYMETA.json
Can't locate local/lib.pm in @INC (you may need to install the local::lib module) (@INC contains: /home/hakon/perl5/lib/perl5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl/5.30/CPAN/FirstTime.pm line 1357.
@hakonhagland
Copy link
Author

Workaround: Install local::lib manually first:

wget https://cpan.metacpan.org/authors/id/H/HA/HAARG/local-lib-2.000028.tar.gz
tar zxvf local-lib-2.000028.tar.gz
cd local-lib-2.000028
perl Makefile.PL --bootstrap
make
make test
make install
perl -I$HOME/perl5/lib/perl5 -Mlocal::lib >> ~/.bashrc
source ~/.bashrc

@hakonhagland
Copy link
Author

I think the problem was that make was not installed. At least that should make make fail with "Command not found" when installing local::lib?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant