Tuesday 6 December 2005

Essential house keeping in Ubuntu

I started using Ubuntu Breezy ver 5.10 a month back on my machine. Prior to that I was exclusively into Fedora. What drew me to Ubuntu was the huge number of packages in its repositories including software which I find useful on a day-to-day basis like Tomboy which I had to compile from source in Fedora. But the Ubuntu CD comes with the base packages which support only open file formats. So if you want support for proprietary file formats like mp3 and quicktime support as well as install software not included on the CD, then you have to do some work.

I call it essential housekeeping because it is not exactly a problem, but only a matter of finding out how to get the necessary support. Here I share my experiences in putting the Ubuntu house in order on my machine.

Adding Universal and Multiverse repositories
The first thing to do in Ubuntu is add the universal and multiverse repositories to the /etc/apt/sources.list file. Usually you need to only uncomment the sections which are commented. But I also found that even the universal repositories did not contain some packages like mplayer. So I had to search the net and find a repository which contained the mplayer package and add it to my sources.list file.
deb cdrom:[Kubuntu 5.10 _Breezy Badger_ - Release i386 (20051012)]/ breezy main restricted
deb cdrom:[Ubuntu 5.10 _Breezy Badger_ - Release i386 (20051012)]/ breezy main restricted

deb-src http://in.archive.ubuntu.com/ubuntu breezy main restricted

deb http://in.archive.ubuntu.com/ubuntu breezy-updates main restricted
deb-src http://in.archive.ubuntu.com/ubuntu breezy-updates main restricted

deb http://in.archive.ubuntu.com/ubuntu breezy universe main restricted
deb-src http://in.archive.ubuntu.com/ubuntu breezy universe

deb http://in.archive.ubuntu.com/ubuntu breezy-backports main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu breezy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu breezy-security main restricted
deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted

deb http://security.ubuntu.com/ubuntu breezy-security universe
deb-src http://security.ubuntu.com/ubuntu breezy-security universe

deb http://ca.archive.ubuntu.com/ubuntu breezy universe
deb http://si.archive.ubuntu.com/ubuntu breezy multiverse
The lines highlighted are those that I added seperately. For example the last line lists the path to the repository which has the mplayer package. I couldn't find the package in any of the other repositories.

Once I added the necessary repositories, the next step was to update the package database in Ubuntu. This I did by running the following command:
$ sudo apt-get update
Once updating was completed (took about 10 minutes), I got ready to install all the software that I found necessary. I had already prepared a list of the software I wanted and so it was only a matter of firing up synaptic (the GUI front end to apt-get ) and installing the software. The software list I prepared was as follows:
  • Flash plugin for firefox web browser
  • mplayer with quicktime and wmv support
  • libdvdcss support for playing encrypted DVDs
  • fluxbox - a light weight window manager. I find Gnome and KDE (with all the eye candy) distracting for doing serious work .
  • GNUCash - A personal finance package
  • Tomboy - A very good note taking application based on Mono.
  • Sun's JDK - For java support
  • Gkrellm - A GUI which gives a graphical display in real time of the system status , like cpu load, memory usage, processes loaded in memory, network traffic and so on which I find really useful.
  • Compiler tools - Ubuntu is a distribution targeted at the ordinary user. So it does not bundle a compiler on the CD. But compiler tools are handy because you never know when you might need to compile a package from source and install on your machine.
  • NVIDIA glx drivers - I have a NVIDIA Geforce 2 MX graphics card. And even though ubuntu contains the nvidia drivers, I had to install the nvidia-glx package manually.
  • Install firestarter - The front end for iptables firewall and configure it. This is desirable because I found that the default installation of Ubuntu leaves the system wide open. Check by running the command:
    $ sudo iptables -L
    With an open system, your machine is just sitting there waiting for getting cracked by crackers and script kiddies or including your machine in a DoS attack.
Other than the flash plugin and mplayer, I did not find any trouble in installing all the software. It was only a matter of selecting the necessary software in synaptic and installing. You can also do it in the command line as follows:
$ sudo apt-get install fluxbox tomboy gnucash

Installing NVIDIA Graphics card drivers
First I installed the glx driver package as follows:
$ sudo apt-get install nvidia-glx
Then I had to enable the driver to be used by X server.
$ sudo nvidia-glx-config enable

Installing Flash plugin
At first I couldn't find the flash player package in synaptic. The problem solved by itself when I accessed a web page which contained a flash component. Firefox informed me that a plugin was missing which was needed to view the component and prompted me to install it by directing me to the macromedia website. And once I installed flash plugin for firefox, I was able to view the flash based websites.

Installing the compiler tools
I installed the compiler tools which contained among others, gcc 4.0 and g++ as follows:
$ sudo apt-get install build-essential
$ sudo apt-get install manpages-dev autoconf automake libtool
$ sudo apt-get install flex bison gcc-doc g++
Now I could easily compile a source package and install it if the need arises.

Installing mplayer

Here I had to do a little more work than above but not as much as you might think. First I downloaded the essential codecs from the mplayer website. It was a bzip2 compressed tar file which was around 9MB in size. I unpacked it and copied the contents into the directory /usr/lib/codecs .
$ tar xvjf essential-20050412.tar.bz2
$ cd essential-20050412
$ sudo mkdir -p /usr/lib/codecs
$ sudo cp -R ./* /usr/lib/codecs/.
Now that the codecs were installed, the next step was installation of mplayer itself. This was achieved with the simple command :
$ sudo apt-get install mplayer-586
$ sudo apt-get install mplayer-fonts
Support for playing encrypted DVDs - libdvdcss
If you want to play encrypted DVDs it is important to have the libdvdcss library installed on your machine. There is a very good site called ubuntuguide.org which lists a method of using apt-get to install this library. But some how, it did not work for me. I got the error message that this package is not available in the repository. So I had to use a more round about way to install this library on my machine.
  • First I downloaded the source file libdvdcss-1.2.8.tar.bz2 using wget from the videolan.org website.
  • Then I unpacked it in my home directory and then compiled and installed it in the /usr directory as follows:
    # tar -xvjf libdvdcss-1.2.8.tar.bz2
    # cd libdvdcss-1.2.8
    # ./configure --prefix=/usr; make; sudo make install
The installation went normally and I was able to play encrypted DVDs on ubuntu.

Housekeeping is a necessary bane for all OSes, whether it be windows, linux or OSX. In Linux, it is a little bit more work because of the licence restrictions imposed by the owners of the popular proprietary format files. But Ubuntu has done a good job of reducing this work as much as possible.

No comments:

Post a Comment