Monday, January 29, 2007

Linux on FreeBSD 6.2

As I mentioned before, I love FreeBSD, without any particular reason. I want to migrate from Ubuntu to FreeBSD, but two Linux applications are holding me back. They are Flash 9 and Gnucash2.

The Flash 9 is required to see some NBA highlights video clips on ESPN.com, but Adobe haven't released version 9 for FreeBSD. It released one for Linux but I heard that (and found that) it crashes often on FreeBSD even it is available in the "port".

Another application is Gnucash. Gnucash 2 is a significant upgrade from version 1.8, since it uses version 2 of Gtk/Gnome instead of version 1. I think it is more user-friendly than the old version and I have been using it for some time on Ubuntu. However, I didn't find Gnucash 2 in the port. There is a unofficial port in the mailing list, as noted by the Wiki on Gnucash site, but I couldn't get it to run.

So I tried to use run the Linux version of Gnucash 2 on FreeBSD. The Linux base availabe on FreeBSD is Fedora Core 4. I have installed it for some time, since it is needed for the acroread7. So I downloaded the Gnucash2 RPM from the Fedora Core 6 site. When I installed using RPM, it failed, saying that the dependencies failed. However, I did find those depended files under /compat/linux (e.g. /bin/sh was reported as missing but I could find it at /compat/linux/bin/sh). After trying for some time, I found that there is a nodeps option for RPM. And later, I found that when the linux_base-fc4 installs the Fedora Core 4 on my FreeBSD, it just extracted the files to /compat/linux using rpm2cpio, but didn't register the installed RPM on the RPM database under /compat/linux/var/lib/rpm. So I tried to install the RPM for the Fedora Core again. But it was tedious due to the dependencies, and I needed to download many other RPM like glibc2, ORBit, etc. finally, when I tried to install the glibc2 or something similar on the system, it says it requires a Linux 2.6 kernel! But I read that FreeBSD is only compatible for the kernel 2.4. So the whole RPM experiment failed. Nevertheless, I have learned how to use the RPM system, and here are some tips for using it on FreeBSD:
  • It is better to set an alias for rpm with a root option to /compat/linux, so that it won't accidentally modified the files on the FreeBSD system. It can be set in .cshrc as
    alias rpm rpm --root /compat/linux
I once didn't set it and accidentally modified a system lib. So I have to go to "make installworld" to restore it.
  • I tried to install the RPM for the FC4 base system. But I think it is better to just register the RPM without modifying the file system. There is a --justdb option which modifies only the DB without touching the file system. So something like this can be used (with the --root /compat/linux set as alias already):
    rpm -Uhv --justdb --nodeps /usr/ports/distfiles/rpm/i386/fedora/4/*.rpm

No comments:

Post a Comment