Produktivity

2006-05-30

Ubuntu, the dumbing down of Linux?

I've spent a couple of days now getting an Ubuntu installation into shape for some development work, so I thought I'd share my experience.

I like Ubuntu, because I'm pretty dumb when it comes to Linux, and Ubuntu lets me get things up and running pretty quickly without having to remember all the configuration 'tricks' needed to get a basic system working. It just works...
However, this time I needed a development environment, and I was surprised that the install of Breezy did not include gcc. Or lynx or ncftp, or pretty much anything that would allow you to do a compile or use cpan (supplied) on the machine.
Maybe I'm old school, but a Linux that doesn't allow you to recompile the kernel (without installing additional stuff) just isn't Linux.
Anyway, my requirements were very basic, I wanted to run Perl to connect to an Oracle 9i database at work, using the fantastic DBI by Tim Bunce.
I had done installations of Oracle on Linux before, and it stretched my limited Linux skills to the limit (patching libraries in the kernel in order to get the Oracle Java (read: portable, run anywhere?!) installer to actually start!!). I was not looking forward to a re-run of that.
Fortunately Oracle have released Oracle Instantclient at version 10, and it looked promising (especially the 33Mb download, instead of 650Mb for the normal one).
So, first things first, let's get Perl working with cpan. Hmmm, half of the tools are missing; no 'make', no 'gcc', no 'lynx', no 'ncftp' etc.
The machine was also behind a firewall, so apt-get didn't work until I configured the http_proxy variable (as 'http://NN.NN.NN.NN:8080'). Then I had to configure apt-get to look at the broader repositories as most of the above apps were not in the standard lists!? Finally I got the applications necessary for cpan to run and then decided to do an install of a Perl package to test out the compile process before attempting the Oracle DBD compile.
XML::Parser would be useful, so I ran 'install XML::Parser' from cpan and watched. Serious compile problems! What the?! 'cannot find Expat.h'.
After some searching, it appears that Expat (by James Clark) is no longer provided with the package and must already be on your machine. Ok, 'apt-get install expat'; nope, package not found. Again some searching and I find libexpat1-dev (?!) install that, after some problems with apt-get repositories require me to rebuild the source.list, and then run a perl Makefile.PL; make; make test...
Everything works! sudo make install...job done (oh, except I haven't done the Oracle install yet!).
Get the instantclient basic (I got the 10.2.0.2), sqlplus and sdk zip files from Oracle (you need an OTN username and password - request lost password!). Unpack the zip files somewhere and create a directory structure for Oracle (I used /opt/oracle). Put sqlplus and glogin in a bin directory under /opt/oracle, create /opt/oracle/network/admin and put the tnsnames.ora file there. You can create a lib directory for the *.so* files, but I didn't bother, I just made LD_LIBRARY_PATH use /opt/oracle. Leave /opt/oracle/sdk as it is, even though it's tempting to rearrange.
Amend your .bashrc (or equivalent) to add the oracle environment vars including ORACLE_USERID and TWO_TASK. ORACLE_BASE and ORACLE_HOME are /opt/oracle. Add /opt/oracle/bin to your PATH.
Now try running 'sqlplus $ORACLE_USERID', this should connect to the SID defined in TWO_TASK. Assuming that works, then go to cpan again.
'install DBI' and 'get DBD::Oracle' (you could just install DBD::Oracle, but it's easier to see what's going on doing it manually)
Change to .cpan/build/DBD_Oracle*, run 'perl Makefile.PL'.
Assuming no problems, run 'make'
If everything compiles then you're almost home...
run 'make test' (make sure your ORACLE_USERID and TWO_TASK are defined correctly)
If tests are ok, then 'sudo make install' and head off for the pub (or a coffee).

Ubuntu, it just works (terms and conditions apply, please see pack for details)!

5 Comments:

At 11:00 AM, Anonymous volx said...

Only Perl is dead... Use Python.

 
At 6:34 AM, Anonymous jim said...

Whatever

 
At 9:47 AM, Anonymous Anonymous said...

Thanks for the write-up, I couldn't what the expat lib was called - libexpat1-dev ???

Thanks

 
At 10:05 AM, Anonymous Anonymous said...

thanks for mentioning the expat lib. I was having problems installing the Mesa 3D drivers on ubuntu. Compiler kept dying cause it couldn't find expat.h and some other XML garbage.

I installed that lib and it worked great!

 
At 7:55 AM, Anonymous Anonymous said...

No man, some, mostly multi-media, end-user things "just work" out of the box but the things that don't work are more screwed up that most Linux distro's. Simple things that other distro's have had working for a decade don't work in Ubuntu. Just setting a static IP address is a pain in the a$$.

 

Post a Comment

<< Home