Tuesday, April 15, 2014

Upgrade perl from CPAN console

Run command cpan, and answer the questions, if you don't know, just keep default.

To reconfigure cpan:
# cpan
cpan[]> o conf init

Report updates for all modules. 
# cpan

cpan[1]> r


# cpan
 cpan[1]> upgrade


End of configuration questions.


Stripping down executable paths...

Creating config.sh...
Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
    Propagating recommended variable $libdb_needs_pthread...

If you'd like to make any changes to the config.sh file before I begin
to configure things, do it as a shell escape now (e.g. !vi config.sh).

Press return or use a shell escape to edit config.sh:
Open another terminal window.
# cd ~/.cpan/build/perl-5.18.2-*

# vi config.sh

 : Configure command line arguments.
config_arg0='./Configure'
config_args='-Dnoextensions=ODBM_File'
config_argc=1
config_arg1='-Dnoextensions=ODBM_File'


Problem

ODBM_File.xs: In function ‘XS_ODBM_File_DESTROY’:
ODBM_File.xs:124: error: too few arguments to function ‘dbmclose’
make[1]: *** [ODBM_File.o] Error 1


Workaround


Post upgrade

Can't call method "http" on unblessed reference at /usr/local/lib/perl5/5.18.2/CPAN/FirstTime.pm line 1868.
 

Solution:

cacti:~ #cpan                                                                                            
Sorry, we have to rerun the configuration dialog for CPAN.pm due to                                       
some missing parameters. Configuration will be written to                                                 
 <</root/.cpan/CPAN/MyConfig.pm>>                                                                         


CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each 
configuration option instead.                                           

Would you like to configure as much as possible automatically? [yes]

Autoconfigured everything but '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] no

Would you like to pick from the CPAN mirror list? [yes]
Found a cached mirror list as of Mon Apr 14 07:11:02 2014

If you'd like to just use the cached copy, answer 'yes', below.
If you'd like an updated copy of the mirror list, answer 'no' and
I'll get a fresh one from the Internet.                         

Shall I use the cached mirror list? [yes] no
Trying to refresh your mirror list         
Fetching with HTTP::Tiny:                  
http://www.perl.org/CPAN/MIRRORED.BY       
Error downloading with HTTP::Tiny: Not a CODE reference at /usr/local/lib/perl5/5.18.2/CPAN/HTTP/Client.pm line 112, <STDIN> line 4.

Fetching with HTTP::Tiny:
http://www.perl.org/CPAN/MIRRORED.BY.gz
Error downloading with HTTP::Tiny: Not a CODE reference at /usr/local/lib/perl5/5.18.2/CPAN/HTTP/Client.pm line 112, <STDIN> line 4.

Fetching with Net::FTP:
ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY
  Could not connect to host 'ftp.perl.org' with Net::FTP
Fetching with Net::FTP                                 
ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY.gz             
  Could not connect to host 'ftp.perl.org' with Net::FTP

Proxy authentication needed!
 (Note: to permanently configure username and password run
   o conf proxy_user your_username                       
   o conf proxy_pass your_password                       
     )                                                   
Username:                                            
Warning: Term::ReadKey seems not to be available, your password will be echoed to the terminal!
Password:                                                                             



Trying with
    /usr/bin/wget -O "/root/.cpan/sources/MIRRORED.BY.tmp14002"
to get                                                        
    http://www.perl.org/CPAN/MIRRORED.BY                      
--2014-04-16 13:06:23--  http://www.perl.org/CPAN/MIRRORED.BY 
Resolving proxy.goweekend.ca... 137.15.210.13               
Connecting to proxy.goweekend.ca|137.15.210.13|:8888... connected.
Proxy request sent, awaiting response... 407 Proxy Authentication Required
2014-04-16 13:06:23 ERROR 407: Proxy Authentication Required.            


    Function system("/usr/bin/wget -O "/root/.cpan/sources/MIRRORED.BY.tmp14002" "http://www.perl.org/CPAN/MIRRORED.BY" ")
    returned status 1 (wstat 256), left                                                                                  
/root/.cpan/sources/MIRRORED.BY.tmp14002 with size 0                                                                     
                                                                                                                         
Trying with                                                                                                              
    /usr/bin/wget -O "/root/.cpan/sources/MIRRORED.BY.tmp14002"                                                          
to get                                                                                                                   
    ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY                                                                              
--2014-04-16 13:06:23--  ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY                                                         
connected.                                                     
Proxy request sent, awaiting response... 200 OK                                                                          
Length: 129952 (127K) [octet/stream]                                                                                     
Saving to: `/root/.cpan/sources/MIRRORED.BY.tmp14002'                                                                    

100%[=================================================================================================================================>] 129,952      364K/s   in 0.3s   

2014-04-16 13:06:24 (364 KB/s) - `/root/.cpan/sources/MIRRORED.BY.tmp14002' saved [129952/129952]


First, pick a nearby continent and country by typing in the number(s)
in front of the item(s) you want to select. You can pick several of 
each, separated by spaces. Then, you will be presented with a list of
URLs of CPAN mirrors in the countries you selected, along with      
previously selected URLs. Select some of those URLs, or just keep the
old list. Finally, you will be prompted for any extra URLs -- file:,
ftp:, or http: -- that host a CPAN mirror.                          

You should select more than one (just in case the first isn't available).

(1) Africa
(2) Asia 
(3) Europe
(4) North America
(5) Oceania     
(6) South America
Select your continent (or several nearby continents) [] 4
(1) Canada                                              
(2) Costa Rica                                          
(3) Mexico                                              
(4) United States                                       
Select your country (or several nearby countries) [] 1  
(1) ftp://CPAN.mirror.rafal.ca/pub/CPAN/                
(2) ftp://cpan.sunsite.ualberta.ca/pub/CPAN/            
(3) ftp://ftp.nrc.ca/pub/CPAN/                          
(4) ftp://mirror.arcticnetwork.ca/pub/CPAN/             
(5) ftp://mirror.csclub.uwaterloo.ca/CPAN/
(6) ftp://mirror.its.dal.ca/cpan/
(7) ftp://mirror.vexxhost.com/cpan/
(8) http://CPAN.mirror.rafal.ca/
(9) http://cpan.arcticnetwork.ca/
(10) http://cpan.mirror.vexxhost.com/
(11) http://cpan.perlnow.com/
(12) http://cpan.sunsite.ualberta.ca/
(13) http://httpupdate25.cpanel.net/CPAN/
(14) http://mirror.csclub.uwaterloo.ca/CPAN/
(15) http://mirror.its.dal.ca/cpan/
(16) http://mirrors.gossamer-threads.com/CPAN/
Select as many URLs as you like (by number),
put them on one line, separated by blanks, hyphenated ranges allowed
 e.g. '1 4 5' or '7 1-4 8' [] 5 14 15 1
Now you can enter your own CPAN URLs by hand. A local CPAN mirror can be
listed using a 'file:' URL like 'file:///path/to/cpan/'

Enter another URL or ENTER to quit: []
New urllist
  ftp://mirror.csclub.uwaterloo.ca/CPAN/
  http://mirror.csclub.uwaterloo.ca/CPAN/
  http://mirror.its.dal.ca/cpan/
  ftp://CPAN.mirror.rafal.ca/pub/CPAN/

Autoconfiguration complete.

commit: wrote '/root/.cpan/CPAN/MyConfig.pm'

You can re-run configuration any time with 'o conf init' in the CPAN shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.

cpan[1]> exit
Terminal does not support GetHistory.
Lockfile removed.
cacti:~ # cpan
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.00)
Enter 'h' for help.

cpan[1]>

2 comments: