I'm getting complaints about 02packages.details.txt.gz when I'm trying to install a package with cpan. The error is "Warning: Your /root/.cpan/sources/modules/02packages.details.txt.gz does not contain a Line-Count header. "
Apparently, according to cpan, this is not a valid zip file, which it isn't. It's just a web page which I'll paste later. I do not use a proxy and I had five mirrors in my configuration. I've deleted one then the next off the list and I'm still getting the same data back. I have deleted the file and attempted to allow cpan to fetch it again. I have fetched the page with curl and I'm seeing a web page and not anything that looks like a gz file.
I have tried "install cpan" from the cpan command line in case I missed an update but that runs into the exact same problem.
Example fetch:
curl http://noodle.portalus.net/CPAN/modules/02packages.details.txt.gz
Result (parts obsfucated)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
function getCookie(c_name) { // Local function for getting a cookie value
if (document.cookie.length > 0) {
c_start = document.cookie.indexOf(c_name "=");
if (c_start!=-1) {
c_start=c_start c_name.length 1;
c_end=document.cookie.indexOf(";", c_start);
if (c_end==-1)
c_end = document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}
function setCookie(c_name, value, expiredays) { // Local function for setting a value of a cookie
var exdate = new Date();
exdate.setDate(exdate.getDate() expiredays);
document.cookie = c_name "=" escape(value) ((expiredays==null) ? "" : ";expires=" exdate.toGMTString()) ";path=/";
}
function getHostUri() {
var loc = document.location;
return loc.toString();
}
setCookie('XXXXXXXXXXXXXXXXXXXXiw_9289NNNNNNNNJAX666', 'MY.IP.ADDRESS.HERE', 10);
try {
location.reload(true);
} catch (err1) {
try {
location.reload();
} catch (err2) {
location.href = getHostUri();
}
}
</script>
</head>
<body>
<noscript>This site requires JavaScript and Cookies to be enabled. Please change your browser settings or upgrade your browser.</noscript>
</body>
</html>
Note that this is the same as the contents as fetched by cpan.
CodePudding user response:
CPAN mirrors have been eliminated.
To fix your choice of mirror, use either
o conf urllist http://www.cpan.org/
or
o conf init urllist
from within the cpan
tool. The first will pick a mirror from the official list. Only one is on the list: http://www.cpan.org/
. The second will pick that mirror directly.
You may need to follow up with o conf commit
to save the changes. (There's no harm in always using it.)
Example:
C:\Users\ikegami>cpan
Loading internal logger. Log::Log4perl recommended for better logging
Unable to get Terminal Size. The Win32 GetConsoleScreenBufferInfo call didn't work. The COLUMNS and LINES environment variables didn't work. at C:\progs\sp5032001001\perl\vendor\lib/Term/ReadLine/readline.pm line 410.
cpan shell -- CPAN exploration and modules installation (v2.28)
Enter 'h' for help.
cpan> o conf init urllist
Now you need to choose your CPAN mirror sites. You can let me
pick mirrors for you, you can select them from a list or you
can enter them by hand.
Would you like me to automatically choose some CPAN mirror
sites for you? (This means connecting to the Internet) [yes] y
Trying to fetch a mirror list from the Internet
Fetching with LWP:
init/MIRRORED.BY
Fetching with LWP:
init/MIRRORED.BY.gz
Fetching with LWP:
http://www.perl.org/CPAN/MIRRORED.BY
Looking for CPAN mirrors near you (please be patient)
.. done!
New urllist
http://www.cpan.org/
commit: wrote 'C:\progs\sp5032001001\perl\lib/CPAN/Config.pm'
cpan> quit
Lockfile removed.
C:\Users\ikegami>
CodePudding user response:
It seems like indeed, one after another of my mirrors was stale. Currently using mirrors.namecheap.com and all looking good.