[英]Can't locate local/lib.pm in @INC at /usr/share/perl/5.14/CPAN/FirstTime.pm
I am trying to use Perl the first time on my system which is Ubuntu 12.04. 我试图在我的系统上第一次使用Perl,这是Ubuntu 12.04。 I have Perl v.5.14.2 installed.
我安装了Perl v.5.14.2。
I looked up how to install Perl modules , so I started as follows: 我查找了如何安装Perl模块 ,所以我开始如下:
$ perl -MCPAN -e shell
The wizard started configuring the environment as can be seen here: http://pastebin.com/5hn8vkb5 该向导开始配置环境,如下所示: http : //pastebin.com/5hn8vkb5
Though, it stopped in the middle with the following error message: 虽然,它在中间停止,出现以下错误消息:
...
Checksum for /home/john/.cpan/sources/authors/id/A/AP/APEIRON/local-lib-1.008009.tar.gz ok
---- Unsatisfied dependencies detected during ----
---- APEIRON/local-lib-1.008009.tar.gz ----
ExtUtils::MakeMaker [build_requires]
Running make test
Make had some problems, won't test
Delayed until after prerequisites
Running make install
Make had some problems, won't install
Delayed until after prerequisites
Can't locate local/lib.pm in @INC (@INC contains:
/home/john/perl5/lib/perl5
/etc/perl
/usr/local/lib/perl/5.14.2
/usr/local/share/perl/5.14.2
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.14
/usr/share/perl/5.14
/usr/local/lib/site_perl
/home/john/Desktop)
at /usr/share/perl/5.14/CPAN/FirstTime.pm line 1300.
What can I do to setup the Perl environment correctly on my Ubuntu installation? 如何在我的Ubuntu安装上正确设置Perl环境?
After interrupting the wizard and restarting it again, there is no error message anymore. 中断向导并再次重新启动后,不再出现错误消息。 How can I start the wizard again so I can choose here:
如何再次启动向导,以便我可以在此处选择:
What approach do you want?
你想要什么方法? (Choose 'local::lib', 'sudo' or 'manual') [local::lib]
(选择'local :: lib','sudo'或'manual')[local :: lib]
You're missing local::lib
, which is what you told CPAN
shell to do. 你缺少
local::lib
,这是你告诉CPAN
shell要做的事情。
You can install it like so: 您可以像这样安装它:
sudo apt-get install liblocal-lib-perl
You might be able to start over by rm -rf
-ing your ~/.cpan
directory. 您可以通过
rm -rf
~/.cpan
目录重新开始。 AT YOUR OWN RISK 由您自担风险
However, I would recommend trying cpanminus
instead of the old CPAN shell
. 但是,我建议尝试使用
cpanminus
而不是旧的CPAN shell
。
sudo apt-get install cpanminus
The local namespace was for your own personal modules and wouldn't be found in CPAN. 本地命名空间用于您自己的个人模块,在CPAN中找不到。 This is something relatively new.
这是一个相对较新的东西。 At many sites, you might need CPAN modules not in the current version of Perl, or you need a newer version of a particular module.
在许多站点,您可能需要不在当前版本的Perl中的CPAN模块,或者您需要更新版本的特定模块。 However, you don't have write access to the standard location where CPAN modules are installed.
但是,您没有对安装了CPAN模块的标准位置的写访问权限。
What this is doing is installing these modules under the $HOME/perl5/lib/local
directory where you'll be able to access them. 这样做是在
$HOME/perl5/lib/local
目录下安装这些模块,您可以在其中访问它们。 You would also need to setup a PERL5LIB
environment variable (usually in your startup scripts), so Perl will check this directory when locating these modules. 您还需要设置
PERL5LIB
环境变量(通常在您的启动脚本中),因此Perl将在查找这些模块时检查此目录。
If you have sudo
privileges, use that to install CPAN modules rather than trying this. 如果您有
sudo
权限,请使用它来安装CPAN模块而不是尝试此操作。 The following will install the Foo::Bar
module into the standard module directory for you (and do any configuration as necessary): 以下将为您安装
Foo::Bar
模块到标准模块目录中(并根据需要进行任何配置):
$ sudo cpan install Foo::Bar
If CPAN needs to be configured, it will do that first. 如果需要配置CPAN,它将首先执行此操作。
There are complete directions on doing the local::lib install for modules on MetaCPAN . 在MetaCPAN上为模块执行local :: lib安装有完整的指示。 They're pretty clear.
他们很清楚。
Several New OS's force (like Redhat 7) force to check presence of local::lib in the perl version, actually its a good thing this enables to users to use CPAN and add,experiment and enjoy new modules to be used with the perl without waiting for sitewide installation (like a root user). 几个新操作系统的强制(如Redhat 7)强制检查perl版本中local :: lib的存在,实际上这是一件好事,它使用户能够使用CPAN并添加,试验和享受与perl一起使用的新模块等待全站安装(如root用户)。 By default local::lib looks for $HOME/perl5 dir where the user's local or downloaded modules are located.
默认情况下,local :: lib查找用户的本地或下载模块所在的$ HOME / perl5目录。 If you see this problem then you have to do following
如果您看到此问题,则必须执行以下操作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.