μHOWTO: Install perl libraries in bulk

When you have to install packages that live out of dpkg, don’t you hate to install their dependencies by hand? I do.
Even though this is exactly what CPAN.pm does, there is a Debian way: If you have another machine with the correct dependencies already installed, you can use dpkg to copy those over.
For instance, this one-liner requests installation of the same Perl libraries that live in another machine:

$ ssh original.machine.com 'dpkg --get-selections'|grep '^lib.*perl'|grep 'install$'|dpkg --set-selections
$ sudo aptitude -f install

You may replace the first regexp to whatever your want (e.g. “^libapache-mod” for perl modules, “^lib.*java” for Java libraries and so on).
Gotta love Debian.
[tags]Debian, Perl, linux, apt, sysadmin[/tags]

One thought on “μHOWTO: Install perl libraries in bulk”

Comments are closed.