在 linux ubuntu 中使用 CPAN 时,我应该使用 sudo / 作为 root 或作为我的默认用户运行它

发布于 2025-01-08 07:34:29 字数 547 浏览 0 评论 0原文

我收到这样的错误

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

俏︾媚 2025-01-15 07:34:29

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

  1. 将模块安装到您的主目录下的目录中。 local::lib 将帮助您进行设置。

  2. 配置cpan以在安装阶段使用sudo。您可以通过启动 cpan shell 并输入:

    o conf make_install_make_command 'sudo make'
    oconf mbuild_install_build_command 'sudo ./Build'
    o 配置提交
    

    第一行将 MakeMaker 配置为使用 sudo。第二行对 Module::Build 执行相同的操作。第三行保存更改。

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

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

  2. 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
    

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

脱离于你 2025-01-15 07:34:29

如果您想安装模块供自己使用,那么您应该自己运行它。使用 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.

放肆 2025-01-15 07:34:29

如果您想以非 root 用户身份安装模块,您可以将 cpan 配置为使用安装库:

makepl_arg         [INSTALL_BASE=/home/nelaar/perl]
mbuildpl_arg       [--install_base=/home/nelaar/perl]

并将 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:

makepl_arg         [INSTALL_BASE=/home/nelaar/perl]
mbuildpl_arg       [--install_base=/home/nelaar/perl]

And set PERL5LIB accordingly to /home/nelaar/perl/lib/perl5.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文