User CPAN installation broken

Here is a workaround for a common problem. You do not have root access the *NIX server to configure perl but want to install perl libraries. Normally the user can use CPAN with local libraries (PERL5LIB).

But sometimes CPAN gets confused and you get an error like this:

Your configuration suggests "/root/.cpan" as your working directory. I could not create this directory due to this error:
mkdir /root/.cpan: Permission denied at /data/eva/perl/lib/perl5/site_perl/5.8.0/ line 552

I search around on Google and found this solution:

Execute the following procedure (it worked for me, though I am not sure if all steps are necessary):

  • Create a directory for the perl modules in your HOME $ mkdir ~/perl5lib
  • Create ~/.cpan and ~/.cpan/CPAN directories: $ mkdir ~/.cpan $ mkdir ~/.cpan/CPAN
  • Create a for the CPAN module with $CPAN::Config empty $ echo "$CPAN::Config = {}" > ~/.cpan/CPAN/
  • Execute again: $ perl -MCPAN -e shell

This time (if all goes well) it will prompt you for the empty fields in $CPAN::Config.

NOTE: What follows is a test of pingbacks. A link should appear on the linked post, The Journey Begins.

3 thoughts on “User CPAN installation broken”

  1. Via a click on a link on the discover page on, I stumbled upon Chris Aldrich’s blog. The blog wall chock full of interesting things to read including Chris’ recent posts about the IndieWeb. It was a term I had never known before. What is the IndieWeb? Here’s what I learned.

    Your content is yours
    When you post something on the web, it should belong to you, not a corporation. Too many companies have gone out of business and lost all of their users’ data. By joining the IndieWeb, your content stays yours and in your control.
    You are better connected
    Your articles and status messages can go to all services, not just one, allowing you to engage with everyone. Even replies and likes on other services can come back to your site so they’re all in one place.
    You are in control
    You can post anything you want, in any format you want, with no one monitoring you. In addition, you share simple readable links such as These links are permanent and will always work.@c

    This weblog, Island in the Net, has been in existing for a while. If we count a few false starts with Google’s Blogger service, then I could say I started blogging much earlier than that. But my journey as a consistent blogger started with the purchase of my first domain blog in 2005. I guess I have been part of the IndieWeb for a long time and didn’t even know it.

Comments are closed.