How to install ODBC on Ubuntu 20.04?

Windows Articles

How to install Screaming Frog SEO Spider on Ubuntu 20.04 / 18.04?

If you are working with blogs and content creation then you should know about SEO. Or in the best case, you have...

How to Configure a Firewall in Ubuntu 20.04 / Debian 10?

There is nothing safe from hackers on the Internet, however, we can implement security measures to be more protected against an attack. With this...

Gnome 3.38 available

Gnome OS is a Linux-based operating system, which has a huge domain in the Linux forums. On September 16, 2020, developers announced...

NVIDIA acquires ARM for $40 billion

Various rumors of an agreement between NVIDIA and SoftBank to acquire Arm. Where NVIDIA announces that they reached an agreement to buy...

How to install CodoForum on Ubuntu 20.04 / Debian 10?

Hi, folks. In this post, I will show you how to install CodoForum in Ubuntu 20.04 /Debian 10. This program is quite useful to...
angeloma
angeloma
Senior Writer and partner

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]
1.-  Installing the build-essential package
1.- Installing the build-essential package

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)… 87.106.19.214
Connecting to ftp.unixodbc.org (ftp.unixodbc.org)|87.106.19.214|: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 [1669501]
2.- Download unixODBC on Ubuntu 20.04
2.- Download unixODBC on Ubuntu 20.04

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
3.- configuring ODBC on Ubuntu 20.04
3.- configuring ODBC on Ubuntu 20.04

Then, using the make command to create the package

:~$ make
4.- Installing UnixODBC on Ubuntu 20.04
4.- Installing UnixODBC on Ubuntu 20.04

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
5.- ODBC on Ubuntu 20.04
5.- ODBC on Ubuntu 20.04

So unixODBC is ready for battle. You can now implement it and connect to various databases such as those made in Microsoft SQL Server.

Conclusion

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.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to install Screaming Frog SEO Spider on Ubuntu 20.04 / 18.04?

If you are working with blogs and content creation then you should know about SEO. Or in the best case, you have...

How to Configure a Firewall in Ubuntu 20.04 / Debian 10?

There is nothing safe from hackers on the Internet, however, we can implement security measures to be more protected against an attack. With this...

Gnome 3.38 available

Gnome OS is a Linux-based operating system, which has a huge domain in the Linux forums. On September 16, 2020, developers announced...

NVIDIA acquires ARM for $40 billion

Various rumors of an agreement between NVIDIA and SoftBank to acquire Arm. Where NVIDIA announces that they reached an agreement to buy...

How to install CodoForum on Ubuntu 20.04 / Debian 10?

Hi, folks. In this post, I will show you how to install CodoForum in Ubuntu 20.04 /Debian 10. This program is quite useful to...
x