Tony Wall’s Blog

Remember quality? A bit more time upfront saves a ton of trouble later ;-)

Discovering Ubuntu Package Names For Perl Modules


Differences in Linux distributions can cause trouble installing dependency packages for Perl modules. Many times you’ll find references to YUM packages which work in Linux builds such as CentOS, but don’t work in Ubuntu.

But there is an easy solution… I came across a nice trick here which explains how to use the online Debian repository to search for package names relating to a particular Perl module.

Basically you take the name of the Perl module you are trying to install support for, split it into path parts then add “.pm” to the end. Take this “file name” and append it to to get a list of package names. Usually the correct package for Ubuntu is the first or one of them.

For example, I was trying to install the Ubuntu equivalent Perl support libraries for “XML::LibXML” and “XML::LibXSLT”. On CentOS I already know the YUM packages are called “perl-XML-LibXML” and “perl-XML-LibXSLT”, but they just don’t exist on Ubuntu with APT-GET. So I did this:

  1. Convert “XML::LibXML” to “XML/” and request in a browser. The first result points to “libxml-libxml-perl” as being the correct package. It works with “apt-get libxml-libxml-perl”, hooray!
  2. Do the same with “XML::LibXSLT” and find “libxml-libxslt-perl”, lovely!

If you have single part module names, that’s fine. For example YAML converts to giving “libyaml-libyaml-perl” as a result.

Tagged , ,

Leave a Reply

Your email address will not be published. Required fields are marked *