Compiling RLWRAP for Oracle Linux 6.1 x86-64
Posted by Martin Bach on September 1, 2011
RLWrap is a great too to enhance the user experience with SQL*Plus by allowing it to make use of the GNU readline library. Search the Internet for RLWrap and sqlplus and you should get plenty of hits explaining how awesome that combination is.
Why am I writing this? I am currently in the process of upgrading my lab reference database server to Oracle Linux 6.1, and in the process I wanted to install the rlwrap tool to get read line support with SQLPlus. It’s actually quite simple, all I did after installing the operating system with the “database server” package is described in the few steps that follow this introduction.
First of all I was surprised that gcc wasn’t installed with the package group, and some other bits were missing too. This can easily be rectified by allowing access to the Oracle Public YUM server. I’m behind a gateway so have to use a proxy server:
[root@rhel61ref rlwrap-0.37]# export http_proxy=http://192.168.xx.10:3128 [root@rhel61ref rlwrap-0.37]# export https_proxy=https://192.168.xx.10:3128
This is a very basic SQUID setup without authentication. It’s also behind a firewall and cannot be accessed from the outside world.
Now with this set, go to /etc/yum.repos.d/ and use wget to get the repository configuration:
[root@rhel61ref rlwrap-0.37]# wget http://public-yum.oracle.com/public-yum-ol6.repo
This file needs to be edited-set “enabled” to 1 for the repository called [ol6_u1_base]. A quick “yum update” as root updates the repository information. I needed the following packages (including dependencies) to be installed as well:
[root@rhel61ref rlwrap-0.37]# yum install gcc [root@rhel61ref rlwrap-0.37]# yum install readline-devel
Now it’s time to get RLWrap itself, at the time of this writing it was version 0.37:
[root@rhel61ref rlwrap-0.37]# wget http://utopia.knoware.nl/~hlub/uck/rlwrap/rlwrap-0.37.tar.gz
I downloaded it to my home directory. There was a small problem related to the configure process:
[root@rhel61ref rlwrap-0.37]# ./configure checking build system type... Invalid configuration `x86_64-unknown-linux-': machine `x86_64-unknown-linux' not recognized configure: error: /bin/sh tools/config.sub x86_64-unknown-linux- failed [root@rhel61ref rlwrap-0.37]#
To work around this, you can use the “–build” flag:
[root@rhel61ref rlwrap-0.37]# ./configure --build=x86_64
This did the trick. After the configure command completed, all I needed to do was to “make” the application and “make install”. Now all I need to do is wait for Oracle to release 18.104.22.168 hopefully around OpenWorld and install it to my system. Until then I’ll have to work on understanding upstart…
The alternative is to grab a RPM from a compatible source, such as EPEL (http://fedoraproject.org/wiki/EPEL), but that depends if you are willing to mix RPMs from different sources which may not be possible due to political reasons.