Zhixian's Tech Blog


How to install unixODBC on Ubuntu

Filed under: computing — Tags: , , , , , , — Zhixian @ 14:04:06 pm

This post describes the steps carried out to build unixODBC from source files.
It then go on to describe the steps carried out to install unixODBC.

This is part of my “How to connect to Sql Server from Ubuntu” series of blog post.


  1. The version of Ubuntu used in this guide is Ubuntu 12.04.2 LTS (Precise Pangoline) 32-bit.
  2. You are trying to connect to Microsoft Sql Server 2008 or later.
  3. You know how to use a terminal session in Ubuntu.

Required materials

  1. unixodbc (as of this writing, latest version is 2.3.1)
    Allows unix/linux platforms to use ODBC to connect to databases
    (downloadable from http://www.unixodbc.org/download.html)

Download source vs apt-get

The apt-get utility in Ubuntu do have a version of unixODBC.
However, it is out-of-date and may not work well with later versions of Microsoft Sql Server and their corresponding database drivers.
This is especially important if you are trying to connect to later versions of Microsoft Sql Server (2005 onwards).
It is recommended that you get the the latest versions of unixODBC when working with the latest Microsoft Sql Server instead of relying on packages in apt-get.

unixodbc installation steps overview

  1. Download source code for unixodbc. (I assume you know how to do this.)
  2. Extract source code out of unixodbc gzipped package.
  3. Compile unixodbc. This involves the following steps:
    1. ./configure
    2. make
    3. make install

Extracting sourcecode out of unixodbc package

1) Assuming you download the unixodbc gzip file to a directory call Downloads in your home directory, you should see something like the below in your file manager:


2)  Right-click on the package.
A popup menu should appear.
Select the menu item “Extract Here” to extract the contents of the package.


3) After the contents of the file were extracted, you should now see something like the below in your file manager:



Compile unixodbc

1) Start a terminal session.
Navigate to the directory where you extract the unixodbc source files.


2) In the folder. configure the compilation process by typing ./configure on the command line.


The system will then check through if the system has all the required components build unixodbc.

3) If you do no see any error messages in the configuration step, you can proceed to build the unixodbc by typing make on the command line.


This is the step that takes the source code and compile them to make unixodbc.

4)  Assuming the compilation succeed, you can now install unixodbc into your system.
This is done by typing make install on the command line.


If you do not have sufficient permissions to install unixodbc into your system, you may see permission denied and error messages.
If that is the case, type sudo make install on the command line instead.


5)  Your final result screen should look like the below.
It would also be useful to note down the directories highlighted below.
These are folders where you will be placing your ODBC configuration.



With this, you have installed unixodbc into your Ubuntu system.


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: