在Linux ubuntu中使用CPAN时,我应该使用sudo /作为root还是作为默认用户运行它 [英] when using CPAN in linux ubuntu should I run it using sudo / as root or as my default user

查看:279
本文介绍了在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安装的软件/库。

Will I still be able to run the software / library's that perl / CPAN installs as a my default user.

在类似Debian的系统上使用CPAN / Perl时的最佳实践是什么。

What is the best practice when working with CPAN / Perl on Debian like systems.

推荐答案

您应该以普通用户身份运行 cpan 命令。您有两种选择:

You should run the cpan command as your normal user. You have two choices:


  1. 将模块安装到主目录下的目录中。 local :: lib

  1. Install modules into a directory under your home dir. local::lib will help you set that up.

配置 cpan 以使用 sudo 在安装阶段。您可以通过启动 cpan shell来实现并键入:

Configure cpan to use sudo during the install phase. You do that by starting the cpan shell and typing:

o conf make_install_make_command 'sudo make'
o conf mbuild_install_build_command 'sudo ./Build'
o conf commit

第一行配置 MakeMaker 使用 sudo 。第二行对 Module :: Build 相同。第三行保存更改。

The first line configures MakeMaker to use sudo. The second line does the same for Module::Build. The third line saves the changes.

这篇关于在Linux ubuntu中使用CPAN时,我应该使用sudo /作为root还是作为默认用户运行它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆