How do I update all my CPAN modules to their latest versions?

老子叫甜甜 提交于 2019-11-27 08:59:26

问题


How do I update all my CPAN modules to their latest versions?


回答1:


An alternative method to using upgrade from the default CPAN shell is to use cpanminus and cpan-outdated.

These are so easy and nimble to use that I hardly ever go back to CPAN shell. To upgrade all of your modules in one go, the command is:

cpan-outdated -p | cpanm

I recommend you install cpanminus like the docs describe:

curl -L https://cpanmin.us | perl - App::cpanminus

And then install cpan-outdated along with all other CPAN modules using cpanm:

cpanm App::cpanoutdated

BTW: If you are using perlbrew then you will need to repeat this for every Perl you have installed under it.

You can find out more about cpanminus and cpan-outdated at the Github repos here:

  • https://github.com/miyagawa/cpanminus
  • https://github.com/tokuhirom/cpan-outdated



回答2:


An easy way to upgrade all Perl packages (CPAN modules) is the following way:

cpan upgrade /(.*)/

cpan will recognize the regular expression like this and will update/upgrade all packages installed.




回答3:


For Strawberry Perl, try:

cpan -u



回答4:


upgrade

BTW there is a help command.




回答5:


Try perl -MCPAN -e "upgrade /(.\*)/". It works fine for me.



来源:https://stackoverflow.com/questions/3727795/how-do-i-update-all-my-cpan-modules-to-their-latest-versions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!