Perl for non-root users

I’ve installed perl on Rocky 8 server. Root user is ok, but non-root users can’t run perl.
This is their error:

$ perl -V
Can’t locate Config.pm: /usr/local/lib64/perl5/Config.pm: Permission denied.
BEGIN failed–compilation aborted.

I checked the file and it doesn’t exist: /usr/local/lib64/perl5/Config.pm
Hence not a permission issue.

Location of the file is:
/usr/lib64/perl5/Config.pm

How to “properly” fix the issue and it’s not working by default, from fresh istallation?

el8, root:

# strace perl -V 2>&1 | grep Config.pm
stat("/usr/local/lib64/perl5/Config.pmc", 0x7ffcdb6b0c90) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib64/perl5/Config.pm", 0x7ffcdb6b0c90) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/perl5/Config.pmc", 0x7ffcdb6b0c90) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/perl5/Config.pm", 0x7ffcdb6b0c90) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/vendor_perl/Config.pmc", 0x7ffcdb6b0c90) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/vendor_perl/Config.pm", 0x7ffcdb6b0c90) = -1 ENOENT (No such file or directory)
stat("/usr/share/perl5/vendor_perl/Config.pmc", 0x7ffcdb6b0c90) = -1 ENOENT (No such file or directory)
stat("/usr/share/perl5/vendor_perl/Config.pm", 0x7ffcdb6b0c90) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/Config.pmc", 0x7ffcdb6b0c90) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/Config.pm", {st_mode=S_IFREG|0644, st_size=3195, ...}) = 0
openat(AT_FDCWD, "/usr/lib64/perl5/Config.pm", O_RDONLY) = 4

el8, regular account:

$ strace perl -V 2>&1 | grep Config.pm
stat("/usr/local/lib64/perl5/Config.pmc", 0x7ffeab66d420) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib64/perl5/Config.pm", 0x7ffeab66d420) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/perl5/Config.pmc", 0x7ffeab66d420) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/perl5/Config.pm", 0x7ffeab66d420) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/vendor_perl/Config.pmc", 0x7ffeab66d420) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/vendor_perl/Config.pm", 0x7ffeab66d420) = -1 ENOENT (No such file or directory)
stat("/usr/share/perl5/vendor_perl/Config.pmc", 0x7ffeab66d420) = -1 ENOENT (No such file or directory)
stat("/usr/share/perl5/vendor_perl/Config.pm", 0x7ffeab66d420) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/Config.pmc", 0x7ffeab66d420) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/Config.pm", {st_mode=S_IFREG|0644, st_size=3195, ...}) = 0
openat(AT_FDCWD, "/usr/lib64/perl5/Config.pm", O_RDONLY) = 4

Both search the same paths and neither fails for me.

The directory /usr/local/lib64/perl5 does not exist either, does it?
There could be a permission issue on the path to the (non-existing) file.

/usr/local/lib64/perl5 directory does exist:

ll /usr/local/lib64/perl5

total 68
drwxr-x— 4 root root 4096 Dec 8 15:45 auto
drwxr-x— 7 root root 4096 Dec 8 15:45 Encode
-r–r–r-- 1 root root 32201 Nov 10 01:10 Encode.pm
-r–r–r-- 1 root root 22950 Nov 10 01:10 encoding.pm
drwxr-x— 2 root root 4096 Dec 8 15:45 Text

First, where did they come from? rpm -qf /usr/local/lib64/perl5/*

Second, subdirectories show permission 0750. What perms does the /usr/local/lib64/perl5 have?

I would say if it’s under /usr/local that they have compiled and installed perl rather than use what the system provides in the Rocky repositories. Or used a third-party repository for a newer version of perl which installs under /usr/local - which hasn’t been mentioned by the OP in what they have exactly installed and how.

In which case, something unsupported has been done. Otherwise, the perl binaries would have been in the places mentioned by @jlehtone

Looks like this is specific to this server only. Maybe someone installed another Perl manually.
Tested on a different server and it’s perl-interpreter installing into
/usr/lib64/perl5/Config.pm
and
/usr/local/lib64/perl5/': No such file or directory

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.