Tuesday, February 13, 2007

mpg123 install troubles in Debian Sarge

Today when installing mpg123 on a Debian/Sarge Linux machine, I encountered a complaint from aptitude that a dependency "oss-compat" was UNAVAILABLE and hence the package was broken.

To overcome this, I discovered that I had to alter a line in my /etc/apt/sources.list file:
deb http://security.debian.org/ stable/updates main contrib non-free


Instructions for adding this line come from the mpg123 page and the Debian errata.

After changing sources.list, I ran apt-get update. Good, this fixed the first problem, but then I ran into another one.

aptitude install mpg123=0.59r-20sarge1
...
Writing extended state information... 0%
Writing extended state information... Done
Setting up libxml-sax-perl (0.12-5) ...
Can't locate object method "save_parsers_debian" via package "XML::SAX" at /usr/bin/update-perl-sax-parsers line 90.
dpkg: error processing libxml-sax-perl (--configure):
subprocess post-installation script returned error exit status 255
dpkg: dependency problems prevent configuration of libxml-libxml-perl:
libxml-libxml-perl depends on libxml-sax-perl (>= 0.11); however:
Package libxml-sax-perl is not configured yet.
dpkg: error processing libxml-libxml-perl (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libxml-simple-perl:
libxml-simple-perl depends on libxml-sax-perl; however:
Package libxml-sax-perl is not configured yet.
libxml-simple-perl depends on libxml-libxml-perl | libxml-sax-expat-perl; however:
Package libxml-libxml-perl is not configured yet.
Package libxml-sax-expat-perl is not installed.
dpkg: error processing libxml-simple-perl (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libxml-sax-perl
libxml-libxml-perl
libxml-simple-perl
E: Sub-process /usr/bin/dpkg returned an error code (1)
Ack! Something bad happened while installing packages...


To get more info:

aptitude search libxml|grep perl
...
u A libxml-libxml-perl - Perl module for using the GNOME libxml2 li
...
C A libxml-sax-perl - Perl module for using and building Perl SA
...
u libxml-simple-perl - Perl module for reading and writing XML

The "u" means "unpacked but not configured". The "C" means "half-configured: the package's configuration was interrupted". The "A" means "automatically installed". This turned out to be a red herring though. The problem was that there are several versions of XML::SAX only one of which has the required save_parsers_debian method:

find / -name SAX.pm -exec grep -H 'save_parsers_debian' {} \;
/usr/share/perl5/XML/SAX.pm:sub save_parsers_debian {


So clearly the perl path, determined by @INC, does not point to the version of SAX.pm which we need. Let's see what it is. Create a file sniff.pl which contains an error:

#!/usr/bin/perl
use sniff; # a non-existent package, so that perl will print @INC

and run it

perl sniff.pl
Can't locate sniff.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at sniff.pl line 2.

Ah, /usr/share/perl5 is in the list but it is preceded by other directories, some of which contain a different version of XML::SAX. Let's promote it to the top of the path:

export PERL5LIB=/usr/share/perl5/
perl sniff.pl
Can't locate sniff.pm in @INC (@INC contains: /usr/share/perl5/ /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at sniff.pl line 2.

Notice how the path has changed. Now we try the install again:

aptitude install mpg123=0.59r-20sarge1
...
mpg123

High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2 and 3.
Version 0.59r (1999/Jun/15). Written and copyrights by Michael Hipp.
Uses code from various people. See 'README' for more!
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!

Great, it works!

Monday, February 05, 2007

JCreator crashes

At work, I use JBuilder for coding Java applications. I'm looking for a nice Java IDE to use at home. JBuilder is ok, but I thought I would try something new (and hopefully cheaper - the Developer version of JBuilder is $400).

One of the main features that I'm looking for is code completion. I hunted around and saw heaps of praise for JCreator, so I downloaded the Pro version (the version which has code completion). I started it up and began to create a project, but the thing almost immediately crashed. After starting it up again, I tinkered with some settings, but upon attempting to open a simple source file, the thing crashed again. At this point I cannot get the JCreator to open a .java source file! I'm using Windows XP, and I assume many of JCreator's users have that OS. So what gives?

I went to the JCreator support form to file a bug report. When I hit the submit button, I saw the contents of the .cgi file handling the POST. Yikes; this is a bad sign. How good can their support be if they don't handle form submissions correctly? As a last resort I sent an email to their support address. I don't have a good feeling about this.

As a temporary workaround, I downloaded JEdit. No code completion, but the thing is a quick download and maybe it'll be sufficient for what I want. I should probably try Eclipse, but my previous experience with that IDE was not altogether positive.