Create and install linux debian package for missing perl module with dh-make-perl

Sometimes you encounter situation when you need a perl module to support your program but perl module is not available from standard linux repositories. Installing perl module from source code is not always good idea so what would be the best is to create package for a particular module using dh-make-perl command. In my case I was missing a poerl module Linux::Usermod and here is what I did:

apt-get install dh-make-perl

dh-make-perl –build –cpan Linux::Usermod

You will need to answer some simple questions if you are running cpan for a first time. At the end dh-make-perl will spit out a debian package and in my case it was: liblinux-usermod-perl_0.69-1_all.deb. All I need to do now is to just use dpkg to install this package:

dpkg -i liblinux-usermod-perl_0.69-1_all.deb

This is nice and clen way of dealing with missing perl packages since its also easy to uninstall it once its not needed.

Leave a Reply

You must be logged in to post a comment.