分类:
2010-08-23 16:25:58
> I need to update perl on a new installation that I am doing. > > I have fumbled through the readme's and install's but just not quite > sure what the best approach is. I tried downloading the source and > building from scratch which went fine (man what a lot of questions), but > when finished the system still was using 5.8.0 instead of 5.8.1 > > I have seen a couple things mention to use CPAN to do the update... but > I can't find what the package/bundle is. I've also seen perl listed as a > port for FreeBSD but wasn't able to find it for OpenBSD. > > Any suggestions? Here's a white-paper I wrote a few years ago, which may help you out. # The following instructions apply particularly to OpenBSD 2.9 # running the out of the box version of perl v5.6.0 su # It is useful to install the following ports first /usr/ports/misc/screen # so you can close your tty without interrupting the compile /usr/ports/net/ncftp # a decent ftp client that works very well with cpan /usr/ports/net/wget # just a good thing to have installed /usr/ports/archivers/unzip # cpan wants to have it /usr/ports/archivers/gtar # GNU tar is better than 'star' which comes with OpenBSD # Install and configure the Cpan module as follows # Cpan will prompt you for some basic config info # it helps to be running screen, or have a second tty open to find the answers # when it asks where lynx is type a [space] and hit [enter] # when it asks where tar is, point it to gtar (assuming it's installed) # when it asks if you want to cache metadata, answer yes perl -MCPAN -e shell cpan> install MD5 cpan> install CPAN cpan> reload cpan cpan> q # Add to or change the lines in Config.pm as follows where necessary vi /usr/libdata/perl5/CPAN/Config.pm 'dontload_hash' => {"Net::FTP" => 1, "LWP" =>1 }, # disable Net::FTP and LWP which usually hang 'tar' => q[/usr/local/bin/gtar], # tell cpan to use gtar (if it's installed) 'lynx' => q[ ], # disable lynx which always hangs and times out cache_metadata=>, # cache metadata to speed things up alot # Backup your current module list perl -MCPAN -e autobundle # That will create a file with a name like # /root/.cpan/Bundle/Snapshot_yyyy_mm_dd_00.pm # Dowload and install the perl 5.8.0 src as follows cd /usr/local/src/ wget gunzip stable.tar.gz tar xvf stable.tar cd perl-5.8.0 ./Configure -de make && make test make install # If you feel brave, point the /usr/bin/perl sym-link to the newer binary ln /usr/local/bin/perl5.8.0 /usr/bin/perl # Install all the old modules for the new perl cp /usr/libdata/perl5/CPAN/Config.pm /usr/local/lib/perl5/5.8.0/CPAN/Config.pm cd /root/.cpan perl -MCPAN -e 'install Bundle::Snapshot_yyyy_mm_dd_00' | tee perl_module_upgrade_results.txt # or if for whatever reason you chose not to sym-link to the newer binary perl5.8.0 -MCPAN -e 'install Bundle::Snapshot_yyyy_mm_dd_00' | tee perl_module_upgrade_results.txt # If at any point in the install Cpan.pm tries to install mod_perl # just ^C to skip that. Presently mod_perl is more trouble than it's worth # for my humble purposes. # So that's pretty much it! # If you want to install any other perl modules, just type: cpan cpan> install MODULE_NAME cpan> q # or simply: perl -MCPAN -e 'install MODULE_NAME' -- ===================== Shaun Fryer ===================== ph: 905-529-0591 ===================== Science is like sex: occasionally something useful comes out of it, but that's not why we do it. -: Richard Feynmann -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 241 bytes Desc: not available Url :