无法为“ local :: lib”创建目录

时间:2019-11-21 07:49:37

标签: perl

我已经从cpan安装了local :: lib。但是再次手动进行引导-perl Makefile.PL −−bootstrap。而且,尽管我在lib.pm处已经有一个文件/usr/share/perl5/local/lib.pm,但是当尝试使用上述命令引导该文件时,该错误会上升:

Loading internal logger. Log::Log4perl recommended for better logging
Attempting to create directory /home/shepherd/perl5
Unable to create /home/shepherd/perl5/lib/perl5/5.28.0: No such file or directory at /usr/share/perl5/local/lib.pm line 717.

因此,如果我已经安装了模块,并且目录可能为dir,为什么引导程序无法创建/home/shepherd/perl5/lib/perl5/5.28.0

I have and own this files:
ls -l ~/perl5
drwxrwxr-x 2 root root 4096 Nov 18 23:03 bin
drwxrwxr-x 3 root root 4096 Oct 28 18:52 lib
drwxrwxr-x 4 root root 4096 Oct 28 18:52 man

ls -l ~/perl5/lib
drwxrwxr-x 25 root root 4096 Nov 21 08:56 perl5

ls -l ~perl5/lib/perl5
drwxrwxr-x  2 root root  4096 Nov 20 19:54 B
drwxrwxr-x  3 root root  4096 Nov 21 08:56 Business
drwxrwxr-x  3 root root  4096 Oct 28 19:08 Class
drwxrwxr-x  2 root root  4096 Nov 20 19:54 Config
drwxrwxr-x  3 root root  4096 Oct 28 19:09 Devel
drwxrwxr-x  2 root root  4096 Oct 28 19:08 Dist
drwxrwxr-x  3 root root  4096 Nov 20 19:54 File
drwxrwxr-x  2 root root  4096 Nov 20 19:54 Hook
-r--r--r--  1 root root 42537 Feb 18  2018 Importer.pm
drwxrwxr-x  3 root root  4096 Oct 28 19:10 IPC
drwxrwxr-x  3 root root  4096 Nov 18 23:03 Log
drwxrwxr-x  3 root root  4096 Nov 20 20:48 Mac
drwxrwxr-x  3 root root  4096 Oct 28 19:09 MIME
drwxrwxr-x  3 root root  4096 Oct 28 18:52 Module
-r--r--r--  1 root root   967 Sep  6 16:40 ok.pm
drwxrwxr-x  2 root root  4096 Nov 19 23:13 OLE
drwxrwxr-x  3 root root  4096 Oct 28 19:08 Perl
drwxrwxr-x  3 root root  4096 Oct 28 19:09 POD2
drwxrwxr-x  2 root root  4096 Oct 28 19:09 Scope
drwxrwxr-x  2 root root  4096 Nov 20 19:56 String
drwxrwxr-x  2 root root  4096 Nov 20 19:54 Task
drwxrwxr-x  3 root root  4096 Oct 28 19:09 Term
drwxrwxr-x  9 root root  4096 Nov 20 19:54 Test
drwxrwxr-x 10 root root  4096 Oct 28 19:09 Test2
-r--r--r--  1 root root  6393 Sep  6 16:40 Test2.pm
drwxrwxr-x  7 root root  4096 Nov 20 19:55 x86_64-linux-gnu-thread-multi

1 个答案:

答案 0 :(得分:1)

local :: lib错误报告错误原因。在这种情况下,问题在于运行程序(shepherd)的用户无权写入/home/shepherd/perl5/lib/perl5来创建/home/shepherd/perl5/lib/perl5/5.28.0

将需要授予用户写入该目录的权限。可以通过将文件的所有权从root更改为shepherd来完成。

chown -R shepherd:shepherd ~/perl5