Hi, folks. In this post, you will learn how to install ODBC on Ubuntu 20.04 through a free implementation. If you use this database access API a lot, it will serve you well.
In a few words, ODBC is an open specification for providing application developers with a predictable API with which to access Data Sources. Data Sources include SQL Servers and any Data Source with an ODBC Driver.
With the need for an open-source implementation and compatibility with other operating systems, unixODBC was born. This project also has a graphical interface that you can use but its potential is in the binaries that offer compatibility with this implementation.
So, let’s go for it.
Installing ODBC on Ubuntu 20.04
Upgrading the system completely is the first step in performing this tutorial.
So, open a terminal and run the following commands:
:~$ sudo apt update
:~$ sudo apt upgrade
Once the installation has been completed, all the basic tools for compiling and building packages must be installed. This can easily be done with the following command:
:~$ sudo apt install build-essential [sudo] password for angelo: Reading package lists… Done Building dependency tree Reading state information… Done The following additional packages will be installed: binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-9 dpkg-dev fakeroot g++ g++-9 gcc gcc-9 gcc-9-base libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-9-dev libgomp1 libisl22 libitm1 liblsan0 libmpc3 libquadmath0 libstdc++-9-dev libtsan0 libubsan1 linux-libc-dev make manpages-dev Suggested packages: binutils-doc cpp-doc gcc-9-locales debian-keyring g++-multilib g++-9-multilib gcc-9-doc gcc-multilib autoconf automake libtool flex bison gdb gcc-doc gcc-9-multilib glibc-doc bzr libstdc++-9-doc make-doc The following NEW packages will be installed: binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-9 dpkg-dev fakeroot g++ g++-9 gcc gcc-9 gcc-9-base libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5 libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-9-dev libgomp1 libisl22 libitm1 liblsan0 libmpc3 libquadmath0 libstdc++-9-dev libtsan0 libubsan1 linux-libc-dev make manpages-dev 0 upgraded, 41 newly installed, 0 to remove and 0 not upgraded. Need to get 39.9 MB of archives. After this operation, 175 MB of additional disk space will be used. Do you want to continue? [Y/n]
This will install all the dependencies we need to install unixODBC on Ubuntu 20.04
The next step is to download the unixODBC source code file. At the time of writing, the latest stable version is 2.3.7
:~$ wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.7.tar.gz --2020-07-20 15:04:40-- ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.7.tar.gz => ‘unixODBC-2.3.7.tar.gz’ Resolving ftp.unixodbc.org (ftp.unixodbc.org)… 184.108.40.206 Connecting to ftp.unixodbc.org (ftp.unixodbc.org)|220.127.116.11|:21… connected. Logging in as anonymous … Logged in! ==> SYST … done. ==> PWD … done. ==> TYPE I … done. ==> CWD (1) /pub/unixODBC … done. ==> SIZE unixODBC-2.3.7.tar.gz … 1669501 ==> PASV … done. ==> RETR unixODBC-2.3.7.tar.gz … done. Length: 1669501 (1.6M) (unauthoritative) unixODBC-2.3.7.tar.gz 100%[=====================================================================================>] 1.59M 6.72KB/s in 2m 59s 2020-07-20 15:07:50 (9.12 KB/s) - ‘unixODBC-2.3.7.tar.gz’ saved 
Then decompress the generated file and go to the unixODBC folder.
:~$ tar xvzf unixODBC-2.3.7.tar.gz :~$ cd unixODBC-2.3.7/
There you prepare the file for compilation:
:~$ ./configure --prefix=/usr/local/unixODBC
Then, using the make command to create the package
And finally, install it on the system by running the following command:
:~$ sudo make install
When the process is finished you can go to the
/usr/local/unixODBC/bin folder and see all the binaries that have been installed.
:~$ cd /usr/local/unixODBC/bin/ :~$ ls
So unixODBC is ready for battle. You can now implement it and connect to various databases such as those made in Microsoft SQL Server.
The implementation of ODBC on Unix systems is done by unixODBC with the guarantee of being opensource and quite stable. It’s a very interesting database project that can be very useful to many professionals. So in this post, I’ve shown you how to install it from the source code.
Please share this post and join our Telegram channel.