在 linux ubuntu 中使用 CPAN 时,我应该使用 sudo / 作为 root 或作为我的默认用户运行它
我收到这样的错误
Running make install Prepending blib/arch and blib/lib of 17 build dirs to PERL5LIB; for 'install' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR: Can't create '/usr/local/man/man3' Do not have write permissions on '/usr/local/man/man3'
You may have to su to root to install the package (Or you may want to run something like o conf make_install_make_command 'sudo make'
我是否仍然能够以默认用户身份运行 perl / CPAN 安装的软件/库。
在 Debian 之类的系统上使用 CPAN / Perl 时的最佳实践是什么?
I get errors like this
Running make install Prepending blib/arch and blib/lib of 17 build dirs to PERL5LIB; for 'install' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR: Can't create '/usr/local/man/man3' Do not have write permissions on '/usr/local/man/man3'
You may have to su to root to install the package (Or you may want to run something like o conf make_install_make_command 'sudo make'
Will I still be able to run the software / library's that perl / CPAN installs as a my default user.
What is the best practice when working with CPAN / Perl on Debian like systems.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该以普通用户身份运行
cpan
命令。您有两种选择:将模块安装到您的主目录下的目录中。 local::lib 将帮助您进行设置。
配置
cpan
以在安装阶段使用sudo
。您可以通过启动cpan
shell 并输入:第一行将 MakeMaker 配置为使用
sudo
。第二行对 Module::Build 执行相同的操作。第三行保存更改。You should run the
cpan
command as your normal user. You have two choices:Install modules into a directory under your home dir. local::lib will help you set that up.
Configure
cpan
to usesudo
during the install phase. You do that by starting thecpan
shell and typing:The first line configures MakeMaker to use
sudo
. The second line does the same for Module::Build. The third line saves the changes.如果您想安装模块供自己使用,那么您应该自己运行它。使用 local::lib 设置环境变量,以便正常工作。您可能希望查看 cpan minus 作为默认 cpan 安装程序的替代方案。
您可能还希望考虑使用 perlbrew 安装完全独立于系统 perl 的较新版本的 perl。
如果您想在系统范围内安装它们,那么我建议(因为您已经标记了这个ubuntu)查看dh-make-perl 生成可以使用 dpkg 安装和卸载的 .deb 文件。
If you want to install your modules for your own use, then you should be running it as yourself. Use local::lib to set up your environment variables so that this works nicely. You may wish to look at cpan minus as an alternative to the default cpan installer.
You may also wish to consider using perlbrew to install a newer version of perl that is completely independent from the system perl.
If you want to install them system wide, then I recommend (since you have tagged this ubuntu) looking at dh-make-perl to produce .deb files that you can install and uninstall with dpkg.
如果您想以非 root 用户身份安装模块,您可以将 cpan 配置为使用安装库:
并将 PERL5LIB 相应设置为
/home/nelaar/perl/lib/perl5
。If you want to install modules as a non-root user, you can configure your cpan to use an install base:
And set PERL5LIB accordingly to
/home/nelaar/perl/lib/perl5
.