[R] how-to: installing R on Knoppix

charles loboz
Sun, 05 Mar 2006 11:47:10 -0000

Installing R on Knoppix

Knoppix is a small LINUX distribution
(http://www.knoppix.net/) runnable from a CD (without
an installation) It can be also installed on a hard
drive from a single CD.  The idea was to reuse an old
laptop with 6gb hard drive and 128mb memory.

I had few days experience with Linux and few years
experience with R. The latter was not required :-)

The Knoppix installation went on flawlessly - using
defaults. Partitioning required rerun, as I preferred
to have a separate swap partition and a separate boot
partition. Putting everything in one big partition
would be less fussy, but I wanted to experiment.
Important: I found several description on how to
install Knoppix onto a hard drive, but all of them
were too long - so I used
http://www.aims.ac.za/resources/tutorials/install/knoppix.php.
The longer descriptions may be useful when you try to
install Knoppix on a computer to run in parallel with
other systems or for older Knoppix versions.

After installing Knoppix looked very impressively -
neat graphics, a lot  of apps (including OpenOffice)
KDE windowing system. All of  that from one CD -
version 4.0.2. This is a really neat-looking system -
even OpenOffice 2.0 (beta) was there.

The laptop was not connectable to the Internet, so I
had to transfer the packages through an USB drive. To
use the usb drive I created first a mount point
       mkdir /mnt/usbhd
then I mounted the usb drive
       mount /dev/sda1 /mnt/usbhd

On my uSB drive I had a package downloaded from CRAN,
debian distribution (Knoppix is 'related' to Debian so
I assumed there will be less problems when using
Debian's packages - I did not try rpms).
As per my mount point I tried to install it as
       dpkg -i
/mnt/usbhd/r-base-core_2.1.1-0woody1_i386.deb
which, naturally, resulted in multiple dependency
errors, because many of the libraries were missing.
After some trial  and error I found that following
packages need to be installed:

	dpkg -i /mnt/usbhd/gcc-3.4-base_3.4.5-3_i386.deb
	dpkg -i /mnt/usbhd/libg2c0_3.4.5-3_i386.deb
	dpkg -i /mnt/usbhd/f2c_20020621-3.4_i386.deb
	dpkg -i /mnt/usbhd/libpng2_1.0.18-1_all.deb
	dpkg -i /mnt/usbhd/atlas2-base_3.2.1ln-15_i386.deb
	dpkg -i /mnt/usbhd/tcl8.3_8.3.5-5_i386.deb
	dpkg -i /mnt/usbhd/tk8.3_8.3.5-4_i386.deb
	dpkg -i /mnt/usbhd/zlib-bin_1.2.3-9_i386.deb

after that I rerun the original
        dpkg -i
/mnt/usbhd/r-base-core_2.1.1-0woody1_i386.deb
which went through without problems
then I changed to directory
        cd /usr/bin
and executed
        R

no problems. I did not have time to test installation
of other R packages - that was just the core.

Observations: 128mb memory is not sufficient - KDE
uses much more. Most likely for a computer like that
much better approach would be to use Damn Small Linux
- a 50mb distribution, descending from  Knoppix I did
not try to install R there, but DSL - when booted -
takes only 30mb of memory, leaving plenty for R
computations. I must try it one weekend...

That's all. I am no LINUX expert - last 10 years I did
spend on Windows (though earlier I did work on UNIX).
Installation was rather easy -  except for hunting for
all these packages.  While all the dependencies are
stated, it is rather tedious to hunt them down.

P.S. Tried to install Fedora Core 3 on that laptop -
took forever and was very slow afterwards. Did not
look as well as Knoppix either. I did not even try to
install FC4, as it requires twice more memory than the
laptop has.

P.P.S. Naturally, with larger memories and computers
Knoppix may not be the best solution - large
distributions like RedHat, FC, Ubuntu, Debian, or
Scientific Linux may be preferable and the
installation of R would be trouble-free. This was an
attempt to revitalize and old and tired computer.