WebSphere MQ and Ubuntu HOWTO
(Update Jan 22, 2011 – I’ve just reproduced all the steps below on a fresh Ubuntu 10.10 install)
Until IBM finally recognizes that Ubuntu is the most popular Linux distribution and starts offering WebSphere MQ DEBs to install, here’s a small HOWTO which will guide you through the installation process. I’m using Ubuntu 9.10 and MQ 7.0.1 (CZ4VEML), both 64-bits, but it’s something I’ve been using since at least Ubuntu 7.04 I think, so it will work reliably with other versions of Ubuntu and MQ as well.
Installation
First untar the CZ4VEML.tar.gz archive and then install rpm and sharutils packages:
dsuch$ sudo apt-get install rpm sharutils
Next try executing the ./mqlicense.sh script which will most probably fail horribly but that’s OK, we’ll work around it
dsuch$ sudo ./mqlicense.sh
Accept the license if it doesn’t end with an error such as the one below ..
Exception in thread "main" java.lang.UnsatisfiedLinkError: fontmanager (libstdc++.so.5: cannot open shared object file: No such file or directory)
.. but if it does, just read the license carefully
dsuch$ less ./licenses/LA_en
I’m assuming the script has failed but if you take a look at it closely you’ll notice that all it does in the end is to create a /tmp/mq_license/license/status.dat file, so we’ll do the same ourselves a couple of times.
Now comes the runtime, preceded by the manual creation of the file which ./mqlicense.sh failed to create.
dsuch$ sudo mkdir -p /tmp/mq_license/license/ dsuch$ sudo touch /tmp/mq_license/license/status.dat dsuch$ sudo rpm -iavh --nodeps --force-debian ./MQSeriesRuntime-7.0.1-0.x86_64.rpm
.. more RPMs to install ..
dsuch$ sudo mkdir -p /tmp/mq_license/license/ dsuch$ sudo touch /tmp/mq_license/license/status.dat dsuch$ sudo rpm -iavh --nodeps --force-debian ./MQSeriesJava-7.0.1-0.x86_64.rpm ./MQSeriesClient-7.0.1-0.x86_64.rpm ./MQSeriesServer-7.0.1-0.x86_64.rpm ./MQSeriesSDK-7.0.1-0.x86_64.rpm ./MQSeriesSamples-7.0.1-0.x86_64.rpm ./MQSeriesTXClient-7.0.1-0.x86_64.rpm
.. and the last batch of RPMs ..
dsuch$ sudo mkdir -p /tmp/mq_license/license/ dsuch$ sudo touch /tmp/mq_license/license/status.dat dsuch$ sudo rpm -iavh --nodeps --force-debian ./MQSeriesMan-7.0.1-0.x86_64.rpm ./MQSeriesKeyMan-7.0.1-0.x86_64.rpm
The newly created mqm user would sure like to use Bash by default
dsuch$ sudo usermod -s /bin/bash mqm
That’s all there is to installing, let’s send some messages now.
Verifying the installation
First change the user to mqm ..
dsuch$ sudo su - mqm
.. and create & start a QM01 queue manager:
mqm$ crtmqm QM01 mqm$ strmqm QM01
Let’s define a Q1 local queue for testing
mqm$ runmqsc QM01
Now cd to /opt/mqm/samp/bin/ which holds various precompiled utilities among which are amqsput and amqsget. By the way, the source code is in /opt/mqm/samp.
Send two messages to the Q1 queue on the QM01 queue manager and quit amsqput with Ctrl-C:
mqm$ ./amqsput Q1 QM01 Sample AMQSPUT0 start target queue is Q1 123 zxc ^C
Now let’s use amqsget to get the messages off Q1 queue and quit with Ctrl-C again, as you can see, there are 2 messages sent there in the previous step:
mqm$ ./amqsget Q1 QM01 Sample AMQSGET0 start message <123> message <zxc> ^C
Removing WebSphere MQ
Use those three commands if for some reason you need to remove MQ from your system.
dsuch$ sudo rpm -qa | grep "MQSeries" | xargs sudo rpm -e --force-debian --noscripts dsuch$ sudo rm -rf /var/mqm dsuch$ sudo userdel mqm
That’s all folks, the rest is in the MQ documentation, using MQ on Ubuntu is in no way different to what RHEL has to offer, it’s simply Linux and everything works just fine. Except for the installer

Thanks a lot for this article, I ll test this tomorrow at work !
Regards,
Julien.
I found that durring the install it failed to create /var/mqm/mqs.ini which without the product did not start. I had to go find an example of the file from another install to get it to work.
On x86_64 I had to manually fix the links in /usr/lib so that they link to 64bit versions of mq libs in /opt/mqm/lib64/ instead of 32bit ones in /opt/mqm/lib/.
Thanks for the very helpful tutorial. One small point though, there seems to be a step missing in the verification section. Running “runmqsc QM01″ gets you a prompt where you need to type “define qlocal(Q1)” in order to actually set up the Q1 queue, then Ctrl-C to exit. After that, the amqsget and amqsput commands work fine.
If you want to run MQ Explorer you have to do it as the logged on user (ie you can not su to mqm and run MQE)
I had some problems creating Objects with my user in MQE (not mqm, adding my user to the mqm group did not work either… a bit rusty on both Linux and WMQ admin I admit)
Loggin on as ´mqm´and running MQE works fine.
While installing MQ Client using mqc7_7.0.1.7_linuxp.tar.gz file . i was having issue in accepting license. It was keep throwing following error
./mqlicense.sh: 115: [[: not found
Displaying license agreement on :0
./lap/jre/jre/bin/java: 1: Syntax error: “(” unexpected
Actually this error was due the jre provided with this MQ Client distribution. so followed the option mentioned below and used the JRE installed in my machine.
sudo bash ./mqlicense.sh -accept -jre /home/singha7/dev/jdk/jdk1.6.0_29/jre/bin/java
it worked for me.
I can add the following from my experience:
I have successfuly converted WS MQ 7.0 rpm’s into working deb’s using alien and dpkg-deb utilities. The alien is the recomended way to install foreign packages.
The usage is simple: alien -cd
-d key says that result will be deb package
-c says that alien should try to convert installation scripts
But after conversion the result deb files will not work. You’ll need to unpack them using ‘dpkg-deb’ (also you’ll need to extract control information). After this was done, you should look through PREINST scripts and remove “check for update”. This check uses first argument which rpm passes to installation scripts and expects that this argument contains a number of currently installed packages. Debian installer does not do this so the command “[ $1 eq 1 ]” will be incorrect. Also you’ll need to remove this parameter from gsk7 packages.
After all’s done just pack you debian packages back and install them.
The only problem if you’re using 64bit Linux system, you’ll anyway need to install 32bit gsk7. Alien would not convert it on 64bit Linux system so you’ll have to do it yourself.