2

I'm attempting to install logitechmediaserver 7.8.0 on my OSMC (Raspbmc) Raspberry Pi. I primarily followed instructions from here, although some of the install did not work (some dependencies missing from the repositories, and the patch failed).

Regardless, I've gotten to the part where I restart the server with sudo service logitechmediaserver start, then tried to test by connecting to http://<pi_local_ip>:9000. This failed, so I stopped the service with sudo service logitechmediaserver stop, then attempted to troubleshoot by manually calling the executable.

$ sudo /usr/sbin/squeezeboxserver
The following modules failed to load: DBI EV XML::Parser::Expat
    HTML::Parser JSON::XS Digest::SHA1 YAML::XS Sub::Name

I attempted to install the missing libraries with apt-get install, but almost none of them helped.

  • libdbi-perl
  • libev-perl
  • libxml-parser-perl works!
  • libhtml-parser-perl was already installed.
  • libjson-xs-perl
  • libdigest-sha-perl
  • nothing under yaml-xs, so installed libyaml-perl instead.
  • libsub-name-perl

How can I install the missing libraries? (So that I can presumably troubleshoot further.)

imz -- Ivan Zakharyaschev
  • 15,113
  • 15
  • 61
  • 123
Sparhawk
  • 19,561
  • 18
  • 86
  • 152

1 Answers1

3

Perl's own package manager is the easiest way to install Perl libraries. Unfortunately, it isn't integrated in the distribution, so you won't get the benefits of the distribution's package management such as stable releases, security updates, or dependency tracking for non-Perl components. So it's better to use this only for modules that are not present in your distribution.

Perl's package manager is called CPAN, after the website of the same name. To interact with CPAN, run

perl -MCPAN -eshell

and follow the setup instructions. For system use, make it install under /usr/local/lib/site_perl or whatever your system lists for

perl -e '$\=$,="\n"; print grep m!^/usr/local!, @INC'

To install a module, use the install command for each of the missing modules. This installs dependencies as well. E.g.

cpan[4]> install YAML::XS

If you have modules that are installed via your distribution (e.g. DBI via libdbi-perl), but the program reports that they “failed to load”, that would be a bug in the program. Maybe it wants a more recent version, or maybe it's messing up the module search path.

Note that the instructions you cite are quite messy and will cause trouble down the line, because they tell you to modify files that are maintained by the package manager. Never do that: your modifications will be lost on upgrade. Instead, if you need to patch some system files, put a patched copy somewhere and instruct the program to load modules from a custom directory, e.g.

mkdir -p /usr/local/lib/lms/perl/Slim
cp /usr/share/perl5/Slim/bootstrap.pm /usr/local/lib/lms/perl/Slim
patch /usr/local/lib/lms/perl/Slim/bootstrap.pm lms-rpi-bootstrap.patch

and edit the startup script of the logitechmediaserver service to set the PERL5LIB environment variable to /usr/local/lib/lms/perl.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
  • Wow, great answer! (+1) Give me a few days to work through it, and I'll accept it when I've finished uninstalling and reinstalling. – Sparhawk Jun 07 '15 at 13:31
  • Unfortunately it looks like my Pi is not powerful enough to install anything in CPAN. I'm hitting `Couldn't untar CPAN-2.10.tar: 'Cannot allocate memory'`. Seems like other [Pis](https://superuser.com/questions/667720/install-perl-module-with-dependencies) have the same problem. – Sparhawk Jun 10 '15 at 10:12
  • @Sparhawk That's odd. I was using CPAN on PCs that were a lot less powerful than even a Pi version 1. Granted they were probably running software that was less big than it is today. – Gilles 'SO- stop being evil' Jun 10 '15 at 10:29
  • I searched around a bit and I think there's some suggestion that it might be a bug, although it's all a bit over my head. – Sparhawk Jun 10 '15 at 12:30
  • @Sparhawk For what it's worth, CPAN works for me on a RPi2, but `install JSON::XS` did use 240MB of RAM, which doesn't fit on a RPi1. I wonder why it's using so much memory (maybe for tests?); it should definitely not need it during untar, that sure looks like a bug. Maybe it's a bug in the version of CPAN.pm you happen to have already installed, try installing the latest CPAN package manually first. To skip tests, use `notest install Module::Name` on the CPAN command line. – Gilles 'SO- stop being evil' Jun 10 '15 at 14:32
  • @Sparhawk Apologies, I ran the previous test on the wrong machine. `install JSON::XS` unpacked and built correctly but failed some tests on the RPi2. I didn't investigate what the problem was. It didn't go over 200MB of RAM. – Gilles 'SO- stop being evil' Jun 10 '15 at 14:54