Bug 1132321 - cpan should offer creating site directories
Summary: cpan should offer creating site directories
Alias: None
Product: Fedora
Classification: Fedora
Component: perl
Version: 20
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
Depends On: 1090112
TreeView+ depends on / blocked
Reported: 2014-08-21 06:41 UTC by unclebob
Modified: 2014-11-10 06:49 UTC (History)
9 users (show)

Fixed In Version: perl-5.18.4-305.fc21
Doc Type: Enhancement
Doc Text:
Clone Of:
: 1158873 (view as bug list)
Last Closed: 2014-11-10 06:28:38 UTC
Type: Bug

Attachments (Terms of Use)
Fix ported to perl-5.18.4 (1.94 KB, patch)
2014-10-30 14:35 UTC, Petr Pisar
no flags Details | Diff

System ID Private Priority Status Summary Last Updated
CPAN 99905 0 None None None Never
Red Hat Bugzilla 717565 0 unspecified CLOSED Perl package tries to touch folder in /usr/local 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1138817 0 unspecified CLOSED Perl core modules are installed into vendor_perl, so they are not updated by cpan 2021-02-22 00:41:40 UTC

Internal Links: 717565 1138817

Description unclebob 2014-08-21 06:41:37 UTC
Description of problem:

The command

    cpan install WeakRef

installed the module incorrectly into


instead of the global directory.

Version-Release number of selected component (if applicable):


How reproducible:

Every time.

Steps to Reproduce:

As root enter-
1. yum install perl-CPAN
2. cpan install WeakRef

Actual results:

Module installed in /root/perl5/..... 

Expected results:

Module installed in 


Additional info:

It is possible to clear this bug by removing /root/.cpan and /root/perl5/, editing out the two lines cpan adds to /root/.bashrc, closing the shell and reopening then rerunning the command, but selecting manual as the installation method.

Comment 1 Petr Pisar 2014-08-21 11:09:19 UTC
This is matter of cpan tool configuration. If you configured cpan to install files into ~/perl5, then it will install it there. If you remove ~/.cpan/CPAN/MyConfig.pm (or the global one under /usr/share/perl5), and run cpan(1) again, you get question, where how to install the files:

Warning: You do not have write permission for Perl library directories.

To install modules, you need to configure a local Perl library directory or
escalate your privileges.  CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use 'sudo' (if available).  You may also
resolve this problem manually if you need to customize your setup.

What approach do you want?  (Choose 'local::lib', 'sudo' or 'manual')

The message is a little bit misleading, because the real error is that /usr/local/{lib*,share}/perl5 do not exist. If select `manual' or if you create the directories, cpan will install into the site perl directories.

Comment 2 unclebob 2014-08-21 11:33:40 UTC
Granted, but the point is that installing out of the box cpan doesn't work. By reading the code and experimenting I manged to get it to life, but for the ordinary user this would be a pain.

As supplied cpan does not let you install modules. To my mind this is wrong.

Comment 3 Petr Pisar 2014-08-21 11:41:31 UTC
Who said that "installing out of the box" means "install into site directories"?

Comment 4 Petr Pisar 2014-08-21 14:43:59 UTC
I think the cpan(1) tool could be augmented to create the site directories if they are missing.

Comment 5 Petr Pisar 2014-10-30 14:05:52 UTC
I fixed it as perl-CPAN-2.05-308.fc22 in F22. Older Fedoras will patch the perl sources.

Comment 6 Petr Pisar 2014-10-30 14:35:54 UTC
Created attachment 952169 [details]
Fix ported to perl-5.18.4

Comment 7 Fedora Update System 2014-10-30 15:39:48 UTC
perl-5.18.4-305.fc21 has been submitted as an update for Fedora 21.

Comment 8 Fedora Update System 2014-10-30 15:40:13 UTC
perl-5.18.4-291.fc20 has been submitted as an update for Fedora 20.

Comment 9 Fedora Update System 2014-10-31 01:26:27 UTC
Package perl-5.18.4-305.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing perl-5.18.4-305.fc21'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2014-11-10 06:28:38 UTC
perl-5.18.4-291.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2014-11-10 06:49:35 UTC
perl-5.18.4-305.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.