文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Proper method to update Perl

Proper method to update Perl

时间:2010-08-23  来源:linscora

> 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 http://www.cpan.org/src/stable.tar.gz
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
=====================
 http://sourcery.ca/
 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 : http://mailman.theapt.org/pipermail/openbsd-newbies/attachments/20031027/475ff5f6/attachment-0001.bin
相关阅读 更多 +
排行榜 更多 +
哥布林弹球b服手游下载

哥布林弹球b服手游下载

休闲益智 下载
小马样式盒游戏下载

小马样式盒游戏下载

休闲益智 下载
异变小镇中文版下载安装

异变小镇中文版下载安装

冒险解谜 下载