Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3322708
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:12:51+00:00 2026-05-17T23:12:51+00:00

How do I overcome Please login with USER and PASS. Passive mode refused. errors?

  • 0

How do I overcome “Please login with USER and PASS.” “Passive mode refused.” errors? – when attempting a CPAN module install from within the cpan shell / cpan> prompt

From the output logs to the terminal it appears to be able to connect to an external Perl/CPAN ftp site from my work server but the remote machine is asking for username/password and is rejecting the connection due to my being in passive mode.

( I’ve tested http://ftp.perl.org separately and have been able to successfully login with user:anonymous password:anonymous )

So,

  1. Where do I put the username/password for CPAN program to supply to this remote perl/cpan machine? ( I assume the username is: anonymous, password: anonymous )
  2. Where do I make a setting to say that I’m in the correct mode (passive/non-passive) such that the remote perl/cpan machine will accept my connection
  3. Anything else I should do after I have resolved these issues?

Terminal output below, followed by Config.pm in CPAN folder on my server.

My machine is a CentOS Linux machine.

I’m trying to get Date::Calc successfully installed – my ultimate aim. Thanks.

Can’t find any answers after a search here and on the internet.

# cpan
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support available (try 'install Bundle::CPAN')

cpan> install Date::Calc
CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Warning: Found only 0 objects in /root/.cpan/Metadata
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
  ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz
LWP failed with code[404] message[File '01mailrc.txt.gz' not found]
Fetching with Net::FTP:
  ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz
Couldn't fetch 01mailrc.txt.gz from ftp.perl.org

Trying with "/usr/bin/links -source" to get
    ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz
ELinks: FTP file error

System call "/usr/bin/links -source "ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz"  > /root/.cpan/sources/authors/01mailrc.txt"
returned status 1 (wstat 256)
Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz] doesn't exist

Trying with "/usr/bin/wget -O -" to get
    ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz
--2010-11-08 15:50:51--  ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz
           => `-'
Resolving ftp.perl.org... 64.27.65.115, 168.143.19.69
Connecting to ftp.perl.org|64.27.65.115|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/CPAN/authors ... done.
==> SIZE 01mailrc.txt.gz ... 174301
==> PASV ... done.    ==> RETR 01mailrc.txt.gz ...
No such file `01mailrc.txt.gz'.


System call "/usr/bin/wget -O - "ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz"  > /root/.cpan/sources/authors/01mailrc.txt"
returned status 1 (wstat 256)
Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz] doesn't exist
Issuing "/usr/bin/ftp -n"
Trying 64.27.65.115...
usage: user username [password] [account]
Local directory now /root/.cpan/sources/authors
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Passive mode refused.
Bad luck... Still failed!
Can't access URL ftp://ftp.perl.org/pub/CPAN/authors/01mailrc.txt.gz.

Please check, if the URLs I found in your configuration file
(ftp://ftp.perl.org/pub/CPAN/) are valid. The urllist can be edited. E.g.
with 'o conf urllist push ftp://myurl/'

Could not fetch authors/01mailrc.txt.gz
Fetching with LWP:
  ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz
LWP failed with code[404] message[File '02packages.details.txt.gz' not found]
Fetching with Net::FTP:
  ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz
Couldn't fetch 02packages.details.txt.gz from ftp.perl.org

Trying with "/usr/bin/links -source" to get
    ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz
ELinks: FTP file error

System call "/usr/bin/links -source "ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz"  > /root/.cpan/sources/modules/02packages.details.txt"
returned status 1 (wstat 256)
Warning: expected file [/root/.cpan/sources/modules/02packages.details.txt.gz] doesn't exist

Trying with "/usr/bin/wget -O -" to get
    ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz
--2010-11-08 15:51:12--  ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz
           => `-'
Resolving ftp.perl.org... 64.27.65.115, 168.143.19.69
Connecting to ftp.perl.org|64.27.65.115|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/CPAN/modules ... done.
==> SIZE 02packages.details.txt.gz ... 950491
==> PASV ... done.    ==> RETR 02packages.details.txt.gz ...
No such file `02packages.details.txt.gz'.


System call "/usr/bin/wget -O - "ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz"  > /root/.cpan/sources/modules/02packages.details.txt"
returned status 1 (wstat 256)
Warning: expected file [/root/.cpan/sources/modules/02packages.details.txt.gz] doesn't exist
Issuing "/usr/bin/ftp -n"
Trying 64.27.65.115...
usage: user username [password] [account]
Local directory now /root/.cpan/sources/modules
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Passive mode refused.
Bad luck... Still failed!
Can't access URL ftp://ftp.perl.org/pub/CPAN/modules/02packages.details.txt.gz.

Please check, if the URLs I found in your configuration file
(ftp://ftp.perl.org/pub/CPAN/) are valid. The urllist can be edited. E.g.
with 'o conf urllist push ftp://myurl/'

Could not fetch modules/02packages.details.txt.gz
Fetching with LWP:
  ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz
LWP failed with code[404] message[File '03modlist.data.gz' not found]
Fetching with Net::FTP:
  ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz
Couldn't fetch 03modlist.data.gz from ftp.perl.org

Trying with "/usr/bin/links -source" to get
    ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz
ELinks: FTP file error

System call "/usr/bin/links -source "ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz"  > /root/.cpan/sources/modules/03modlist.data"
returned status 1 (wstat 256)
Warning: expected file [/root/.cpan/sources/modules/03modlist.data.gz] doesn't exist

Trying with "/usr/bin/wget -O -" to get
    ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz
--2010-11-08 15:51:31--  ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz
           => `-'
Resolving ftp.perl.org... 64.27.65.115, 168.143.19.69
Connecting to ftp.perl.org|64.27.65.115|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/CPAN/modules ... done.
==> SIZE 03modlist.data.gz ... 182988
==> PASV ... done.    ==> RETR 03modlist.data.gz ...
No such file `03modlist.data.gz'.


System call "/usr/bin/wget -O - "ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz"  > /root/.cpan/sources/modules/03modlist.data"
returned status 1 (wstat 256)
Warning: expected file [/root/.cpan/sources/modules/03modlist.data.gz] doesn't exist
Issuing "/usr/bin/ftp -n"
Trying 64.27.65.115...
usage: user username [password] [account]
Local directory now /root/.cpan/sources/modules
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Passive mode refused.
Bad luck... Still failed!
Can't access URL ftp://ftp.perl.org/pub/CPAN/modules/03modlist.data.gz.

Please check, if the URLs I found in your configuration file
(ftp://ftp.perl.org/pub/CPAN/) are valid. The urllist can be edited. E.g.
with 'o conf urllist push ftp://myurl/'

Could not fetch modules/03modlist.data.gz
Going to write /root/.cpan/Metadata
Warning: Cannot install Date::Calc, don't know what it is.
Try the command

    i /Date::Calc/

to find objects with matching identifiers.

/usr/lib/perl5/5.8.8/CPAN/Config.pm :-

# This is CPAN.pm's systemwide configuration file. This file provides
# defaults for users, and the values can be changed in a per-user
# configuration file. The user-config file is being looked for as
# ~/.cpan/CPAN/MyConfig.pm.

$CPAN::Config = {
  'build_cache' => q[10],
  'build_dir' => q[/root/.cpan/build],
  'cache_metadata' => q[1],
  'cpan_home' => q[/root/.cpan],
  'dontload_hash' => {  },
  'ftp' => q[/usr/bin/ftp],
  'ftp_proxy' => q[],
  'getcwd' => q[cwd],
  'gpg' => q[/usr/bin/gpg],
  'gzip' => q[/bin/gzip],
  'histfile' => q[/root/.cpan/histfile],
  'histsize' => q[100],
  'http_proxy' => q[],
  'inactivity_timeout' => q[0],
  'index_expire' => q[1],
  'inhibit_startup_message' => q[0],
  'keep_source_where' => q[/root/.cpan/sources],
  'links' => q[/usr/bin/links],
  'make' => q[/usr/bin/make],
  'make_arg' => q[],
  'make_install_arg' => q[],
  'makepl_arg' => q[],
  'ncftp' => q[],
  'ncftpget' => q[],
  'no_proxy' => q[],
  'pager' => q[/usr/bin/less],
  'prerequisites_policy' => q[ask],
  'scan_cache' => q[atstart],
  'shell' => q[/bin/bash],
  'tar' => q[/bin/tar],
  'term_is_latin' => q[1],
  'unzip' => q[/usr/bin/unzip],
  'urllist' => [q[ftp://ftp.perl.org/pub/CPAN/]],
  'wget' => q[/usr/bin/wget],
};
1;
__END__

Update:

In response to daxim’s comment on his answer: “You can edit comments. – Either edit Config.pm, the key urllist is an arrayref of strings; or run o conf urllist at the CPAN prompt. – daxim 16 hours ago” – I tried your suggestions below, daxim:

First I tried:

  cpan> o conf urllist
    urllist
        ftp://ftp.perl.org/pub/CPAN/
Type 'o conf' to view configuration edit options

Followed instructions (i.e. 3rd example bullet under heading “changing of list values: o conf KEY SHIFT|UNSHIFT|PUSH|POP|SPLICE|LIST” at http://search.cpan.org/~andk/CPAN-1.9402/lib/CPAN.pm#changing ) to add a http mirror from: http://www.cpan.org/SITES.html

cpan> o conf urllist http://mirror.ox.ac.uk/sites/www.cpan.org/ ftp://ftp.perl.org/pub/CPAN/

cpan> o conf urllist
    urllist
        ftp://ftp.perl.org/pub/CPAN/
Type 'o conf' to view configuration edit options


cpan>

So from the above, my HTTP mirror was not added. Can anyone offer some advice?

So then I tried: “Either edit Config.pm, the key urllist is an arrayref of strings; “:

The relevant snippet in Config.pm is:

 'urllist' => [q[ftp://ftp.perl.org/pub/CPAN/]],
  'wget' => q[/usr/bin/wget],

How would my arrayref look here – with my list of mirrors. i.e. tell me how I should edit it, please.

Update 2:

The instructions given in http://search.cpan.org/~andk/CPAN-1.9402/lib/CPAN.pm#changing (3rd example bullet), to add a URL to the urllist are incomplete, i.e. wrong, they missed out the push. The successful command is:

[root CPAN]# cpan
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support available (try 'install Bundle::CPAN')

cpan> o conf urllist push http://mirror.ox.ac.uk/sites/www.cpan.org/

cpan> o conf urllist
    urllist
        ftp://ftp.perl.org/pub/CPAN/
        http://mirror.ox.ac.uk/sites/www.cpan.org/
Type 'o conf' to view configuration edit options


cpan>

From:

http://www.perlmonks.org/?node_id=551175

Other important things:

Beforehand, must check if installing a new module, whether or not it also installs dependencies – i.e other modules – and if they are newer versions of those existing on the machine and therefore if their behaviour or interface has changed that would impact existing applications running on the machine: Does CPAN installing of new modules impact Perl-CGI applications on same live production server?

Update 3:

It would appear that editing the urllist is not persistent, as, on re-entering cpan after previous exit, only the ftp entry remains.

cpan> o conf urllist
    urllist
        ftp://ftp.perl.org/pub/CPAN/
Type 'o conf' to view configuration edit options
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T23:12:52+00:00Added an answer on May 17, 2026 at 11:12 pm

    Overcome FTP problems (it’s a really stupid network protocol) by selecting a HTTP mirror.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a JSON string to pass a variable in JavaScript from PHP
Please Help me.I am trying to over come this paoblem from last 2 days
I've tried to overcome this for a while. I'm trying to record sound, but
Does anyone know of any way to overcome NotSupportedException? I have a method against
Is there any solution to overcome case-sensitive problem for contains method. I have code
I've tried and tried so hard to overcome this problem the past few days
how to increase heap size? or how to overcome the problem related to heap
I am trying to put a layout together with jquery-ui-layout and can't overcome the
I'm not yet a fan of integrated development environments, but I'm trying to overcome
I am having trouble getting the Android Development Tools to install. I overcame one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.