When using CPAN on linux ubuntu I have to start it using sudo / as root or as my default user

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'

I can still run the software / library that perl / CPAN installs as my default user.

What is the best practice for working with CPAN / Perl on such Debian systems.

+8
linux perl ubuntu install configuration
source share
3 answers

You should run the cpan command as a regular user. You have two options:

  • Install the modules in the directory under the home registry. local :: lib will help you install this.

  • Configure cpan to use sudo during the installation phase. You do this by running 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.

+15
source share

If you want to install your modules for your own use, you must run it as yourself. Use local :: lib to set up environment variables for this to work well. You can look at cpan minus as an alternative to the cpan default installer.

You may also consider using perlbrew to install a newer version of perl, completely independent of the perl system.

If you want to install them all over the system, I recommend (since you checked this ubuntu) looking at dh-make-perl to create .deb files that you can install and remove with dpkg.

+7
source share

If you want to install modules as a non-root user, you can configure your cpan to use the installation base:

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

And install PERL5LIB respectively /home/nelaar/perl/lib/perl5 .

+3
source share

All Articles