Firebird Documentation Index → Setting up Firebird on Ubuntu Linux
Firebird Home Firebird Home Firebird Documentation IndexNext: Document history

Setting up Firebird on Ubuntu Linux

Rodney Gedda

Marius Popa

14 May 2011 – Document version 2.3


Table of Contents

Setting up Firebird on Ubuntu Linux
A. Document history
B. License notice

Setting up Firebird on Ubuntu Linux

This article describes the process of installing and running Firebird on Ubuntu Linux. It should also work without modification in the Debian GNU/Linux distribution (stable version named Squeeze and unstable version named Sid). Ubuntu is based on Debian core packages. Installing software with Ubuntu (or Kubuntu) is very straightforward and Firebird is no exception. This guide is based on Ubuntu 10.04 LTS “Lucid Lynx”.

The version of Firebird packaged with Ubuntu “Lucid Lynx” is 2.1.3 and is included by default and is the latest stable. For other Ubuntu releases there is a Firebird stable ppa repository from where you can install it.

With administrator privileges on the target machine, issue the following command:

      $ sudo su
      # apt-get install firebird2.1-super
      

Apt's dependency tracking will automatically propose all the packages required for a complete installation with the following output:

      The following extra packages will be installed:
      firebird2.1-common firebird2.1-server-common libedit2
        libfbclient2 libicu38
      Suggested packages:
      firebird2.1-doc
      The following NEW packages will be installed:
      firebird2.1-common firebird2.1-server-common firebird2.1-super
        libedit2 libfbclient2 libicu38
      0 upgraded, 6 newly installed, 0 to remove and 1 not upgraded.
      Need to get 11.7MB of archives.
      After unpacking 28.4MB of additional disk space will be used.
      Do you want to continue [Y/n]? y
      

The packages will then download and install on the target machine. A new user “firebird” will be created to run the server, but the server will not yet be started by default:

      Selecting previously deselected package firebird2.1-super.
      (Reading database ... 542436 files and directories currently
        installed.)
      Unpacking firebird2.1-super 
        (from .../firebird2.1-super_2.1.3.18185-0.ds1-6build1_i386.deb) ...
      Processing triggers for ureadahead ...
      Setting up firebird2.1-super (2.1.3.18185-0.ds1-6build1) ...
      Created default security.fdb
      * Firebird 2.1 server manager not running.
      * Not starting Firebird 2.1 server manager
      * Use `dpkg-reconfigure firebird2.1-super' to enable.
      

If you want Firebird to start automatically, run dpkg-reconfigure on the package and click the Yes button. Then you will be asked again for the SYSDBA password:

      # dpkg-reconfigure firebird2.1-super
      

If all goes well, Firebird Superserver will be started:

      * Firebird 2.1 server manager not running.
      * Starting Firebird 2.1 server manager...               [ OK ]
      * Firebird 2.1 server manager already running.
      

If you're a seasoned Unix person but new to Ubuntu, you might be wondering where all the Firebird files are residing in the directory hierarchy. To see where all the files were installed by Apt, simply do:

      # dpkg -L firebird2.1-super
      /.
      /etc
      /etc/init.d
      /etc/init.d/firebird2.1-super
      /etc/default
      /etc/default/firebird2.1-super
      /usr
      /usr/share
      /usr/share/doc
      /usr/share/lintian
      /usr/share/lintian/overrides
      /usr/share/lintian/overrides/firebird2.1-super
      /usr/bin
      /usr/bin/nbackup
      /usr/bin/qli
      /usr/bin/gbak
      /usr/bin/gfix
      /usr/bin/gpre
      /usr/bin/isql-fb
      /usr/bin/gsec
      /usr/bin/fbstat
      /usr/bin/gdef
      /usr/lib
      /usr/lib/firebird
      /usr/lib/firebird/2.1
      /usr/lib/firebird/2.1/bin
      /usr/lib/firebird/2.1/bin/fbmgr
      /usr/lib/firebird/2.1/bin/fbmgr.bin
      /usr/lib/firebird/2.1/bin/fb_lock_print
      /usr/lib/firebird/2.1/bin/fbguard
      /usr/lib/firebird/2.1/bin/fbserver
      /usr/lib/firebird/2.1/UDF
      /usr/lib/firebird/2.1/UDF/fbudf.so
      /usr/lib/firebird/2.1/UDF/ib_udf.so
      /usr/share/doc/firebird2.1-super

As mentioned, a new user “firebird” is created on the target machine. With administrator access, set a password for this new user:

      # passwd firebird
      Enter new UNIX password:
      Retype new UNIX password:
      

Now you can switch to the firebird user with the su command if required.

Install the examples and dev files:

      # apt-get install firebird2.1-examples firebird2.1-dev 
      

The example databases will wind up in the directory tree /usr/share/doc/firebird2.1-examples/examples/.

Now you can test your Firebird installation by connecting to an example database. Decompress the employee.fdb example database:

      # cd /usr/share/doc/firebird2.1-examples/examples/empbuild/
      gunzip employee.fdb.gz
      chown firebird.firebird employee.fdb
      mv employee.fdb /var/lib/firebird/2.1/data/
      

Fire up the interactive shell and at the SQL> prompt connect to the employee database using the connect statement:

      isql-fb
      SQL> connect "/var/lib/firebird/2.1/data/employee.fdb" user 'SYSDBA'
               password 'SYSDBApassword';
      

(replacing SYSDBApassword with the correct password for SYSDBA!)

When you manage to successfully connect to the database you will see the message:

      Database:  "/var/lib/firebird/2.1/data/employee.fdb", User: SYSDBA
      SQL>
      

Now, from the SQL> prompt, feel free to browse around the employee database. For instance, you can list the tables and check the server version:

      SQL> show tables;
       COUNTRY                                CUSTOMER
       DEPARTMENT                             EMPLOYEE
       EMPLOYEE_PROJECT                       JOB
       PROJECT                                PROJ_DEPT_BUDGET
       SALARY_HISTORY                         SALES
      SQL> show version;
      ISQL Version: LI-V2.1.3.18185 Firebird 2.1
      Server version:
      Firebird/linux Intel (access method),
        version "LI-V2.1.3.18185 Firebird 2.1"
      Firebird/linux Intel (remote server),
        version "LI-V2.1.3.18185 Firebird 2.1/tcp (borkstationx32)/P11"
      Firebird/linux Intel (remote interface),
        version "LI-V2.1.3.18185 Firebird 2.1/tcp (borkstationx32)/P11"
      on disk structure version 11.1
      SQL> quit;
      

If you want a GUI admin tool, you might check FlameRobin, which is included in the Ubuntu repository. It can be installed with a simple:

      # apt-get install flamerobin
      

If you get an error message like “Statement failed, SQLCODE = -551 no permission for read-write access to database /var/lib/firebird/2.1/data/employee.fdb”, then the server process doesn't have read or write access to the database file. Change the ownership of the database to the user firebird with:

      # cd /var/lib/firebird/2.1/data/
      # chown firebird:firebird employee.fdb
      

If you've made it this far, your Firebird installation on Ubuntu has been a success. Have a nice day!

Firebird Documentation IndexNext: Document history
Firebird Documentation Index → Setting up Firebird on Ubuntu Linux