Search code examples
perlubuntuinstallationperl-module

How to install all perl modules at once in Ubuntu


I want to install all available perl modules at once in Ubuntu. Is such a thing possible?


Solution

  • As others have said, you probably don't want to.

    • Many modules are updated more frequently on CPAN than the Ubuntu repos
    • Some modules aren't in the repos at all.
    • Many modules will have dependencies you don't need.
    • If you ever need more than one environment, it's a problem (although to be fair, this is generally a much rarer occurrence with perl than with other ecosystems).
    • perlbrew and cpanm are lovely and don't require `sudo
    • It's not a replacement for proper dependency management as if you ever have a distro upgrade, not all packages may be provided next time.

    ... however, if you're determined, a very straightforward way would be to look at the output of

    sudo apt-get search perl | sed -e 's/ - .*//'
    

    ... and if it's to your liking, run

    sudo apt-get search perl | sed -e 's/ - .*//' | xargs sudo apt-get install
    

    Personally, I'd probably stick a | egrep '-perl' | in there, too before the xargs, as you might get hits based on the description that don't represent actual perl modules.