Installing and upgrading MQ on Ubuntu

I went through the documentation for migrating midrange MQ up to the latest level (9.1.1) for MQ on Ubuntu,and for installing fix packs.

It felt like it had not been properly tested, nor tested in a typical enterprise environment, so Ive written up some of the missing, or well hidden documentation.

Use this blog post with the IBM documentation. I am just trying to fill the holes.

If you are using a descendant of Debian such as Ubuntu, then you have .deb packages. If you are using Fedora, CentOS, or RedHat, then you have .rpm packages

You cannot use multi version ( eg 9.0.0, 9.0.1 or 9.1 at the same time) on Ubuntu as multi version is only supported with rpm, or with containers(Docker). See here.

Many pages in the knowledge centre say, or imply you can do “side by side” migration, and use multi version on mid range. You cannot do this if you are using .deb files.

Updating route

MQ levels are listed as v.r.m.fp so you can have 9.1.0.1 which is MQ Version 9 release 1 modification 0 at fix pack1

  • If v.r.m is the same, you are just installing a fix pack, and so you can upgrade.
  • Otherwise you have to uninstall the old version and install the newer version.

To find out what you is installed you can use dpkg-query -l “ibmmq*”     (Check the double quotes if doing cut and paste)

You can download the MQ code from here. It used to be Passport Advantage, or from developer.ibm.com.

I used v9.1.1 Continuous Delivery Release- Windows/ Linux/ Ubuntu.

I down loaded mqadv_dev910_ubuntu_x86-64.tar.gz.
Note: from the name you can tell

  • it is 9.1.0
  • for Ubuntu
  • x86-64 bit.

I downloaded a fix pack: 9.1.0-IBM-MQ-UbuntuLinuxX64-FP0001.tar.gz

I also (by accident) downloaded a file with .rpm files in it – which were for Redhat – not Ubuntu. So check before you download.

Installation steps.

I followed the documentation here.

It says logon as root. I could not (and would not) do that on my machine so I had to use sudo in front of commands. I believe you should be super-user only for those commands that need it, so switching to root for the duration of the install is a no-no outside of a sandbox. It you switch to root – be careful when deleting files!

  1. List what is currently installed, so you know what to (re)install. Use one of the following commands. dpkg-query provides more information.
    1. apt list –installed “ibmmq*”
    2. dpkg-query -l “ibmmq*”
  2. If you need to delete the old version use sudo apt remove “ibmmq-*”. Use quotes around ibmmq-* in case you are in a directory with file names beginning with ibmmq- .
  3. Download the file with the updated code.
  4. cd to the directory where the file with the *.gz is located.
  5. Check to see if you have an existing MQServer directory, if so rename it, because the tar will put the files in this directory and overwrite what is in the directory.
  6. If this is a v.r.m install, the tar unpack command will create a directory called MQServer.
    1. Unpack the file: tar -zxvf ...tar.gz
    2. This creates a directory MQServer. I renamed this to be MQServer910 so it was clear what level this is for.
    3. Within this MQServer directory it has files like ibmmq-client_9.1.0.0_amd64.deb (the client code), ibmmq-msg-de_9.1.0.0_amd64.deb (a national Language file) , and other files such as mqlicense.sh
  7. If this is a fix pack, no sub-directory is created, and the files are unpacked to the current working directory. To make it easier to manage, create a directory for the files, and tar unpack the files in to it.
    1. Create a directory cd MQServer9101
    2. cd MQServer9101
    3. tar -zxvf ./...tar.gz
    4. the files are named like ibmmq-client-u9101_9.1.0.1_amd64.deb
  8. You can now delete the ….gz file.

You need to decide which of these components you need to install, such as AMS, server, and which languages.

  • This page lists all of the components.
  • This page lists the packages, components and dependencies.
  • This page has the IBM instructions for installing MQ, a list of the packages and components.

Checking dependencies

You can display details of each file and the rm .dependencies, using the command

dpkg -I ./ibmmq-client_9.1.1.0_amd64.deb

Package: ibmmq-client
Version: 9.1.1.0
Maintainer: IBM
Description: IBM MQ Client FileSet
IBM MQ for Developers for Linux for x86_64
5724-H72
This package provides the IBM MQ non-Java MQI client API,
which permits applications to communicate with a IBM MQ
queue manager.

Architecture: amd64
Homepage: http://www.ibm.com/products/mq
Section: non-free/misc
Priority: extra
Installed-Size: 20056
Pre-Depends: ibmmq-runtime (=9.1.1.0)

Installing MQ on Ubuntu.

If you are installing a fix pack, you can have the both base and the fix pack installed at the same time.

Installing a new or different level of v.r.m.

If you are changing the level of v.r.m, you need to delete any older version. You can use the command sudo apt remove “ibmmq-*” to remove the older version.

You must install the license. Use cd to get into the MQServer directory.

sudo ./mqlicense.sh -text_only

You are unlikely to want to install all of the MQ code; do you really need all of the languages installed? Some files have a dependency on other files. Make a note of the components you need (or be lazy and install ibmmq-*).

You have a choice of 2 ways of installing the code.

  1. Use apt, specify the long names of the components to be installed – and manually install the pre-reqs. You specify all the components you need to install. The install reports if a pre-req is missing and does not do the install.
  2. Do some additional customising and use apt . You specify the short names of the components you want to install, and the pre-reqs are installed automatically.

You can use dpkg, but you have to take more care, and may need to fix up problems if you do not get the dependencies installed in the right order.s

Specify the long names of the components to be installed – and manually install the pre-reqs.

You can use specify the components individually.

Use the ls shell command to list what files there are to install. Specify the full name. You can use sudo apt install ./ibmmq-client and tab to do auto-complete. Note the ./ before each file.

sudo apt install ./ibmmq-client_9.1.1.0_amd64.deb ./ibmmq-runtime_9.1.1.0_amd64.deb

where you specify the components – in any order. Apt will identify dependencies, and report if any dependencies are missing. Either add the dependency to the list to be installed, or install the dependency, and retry the command.

Once you have installed the components, you can delete the files in the MQServer directory. If you do delete the files and you need to install an additional component at a later date, you will have to download the .gz file again and unzip it, so you may want to keep the MQServer directory around.

You can customise apt and get it to install the pre-req components. You use the short name rather than the long name.

You need to issue the following command for the directory with the .deb files in it.

chmod -R a+rx MQServer

You need to create a file such as MQ.list in the /etc/apt/sources.list.d directory.

Check to see if there is already a file for MQ in /etc/apt/sources.list.d. If so this will need to be updated or replaced.

I found it easier to create the file MQ.list then use sudo cp MQ.list /etc/apt/sources.list.d/

My file, looks like

# Local directory containing IBM MQ packages
# fix pack
deb [trusted=yes] file:/home/colinpaice/snap/firefox/common/Downloads/MQServer9101 ./
# base code
deb [trusted=yes] file:/home/colinpaice/snap/firefox/common/Downloads/MQServer910 ./

Your file may have just one, or more than one line, depending on the number of fix packs you have installed.

Use sudo apt update to refresh apt repository.

You can now use the sudo apt list “ibmmq*” command to show what can be installed.

When installing 9.1.0 fix pack 1, this command gave

...
ibmmq-runtime/unknown,now 9.1.0.0 amd64
ibmmq-runtime-u9101/unknown,now 9.1.0.1
...

Below are sections on

  1. Installing ( for the first time)
  2. Upgrading with a fixpack from v.r.x.a to v.r.x.b

Installing for the first time

You can specify the components you want, and let apt resolve the pre-reqs

sudo apt install ibmmq-client ibmmq-server

you can type ibmmq-cl tab for auto complete. You do not specify the …_9.1.1.0_amd64.deb.

To install the fix pack type

If the v.r.m between the installed and the new level are different.

to give you

sudo apt install ibmmq-client-u9101 ibmmq-server-u9101

To remove the fix pack entry use

sudo apt remove ibmmq-client-u9101 ibmmq-server-u9101

For the first install, I used

sudo apt install ibmmq-client ibmmq-server ibmmq-sdk ibmmq-gskit ibmmq-jre ibmmq-samples

It gave me

Reading package lists… Done

Building dependency tree

Reading state information… Done

The following additional packages will be installed:

ibmmq-runtime

The following NEW packages will be installed

ibmmq-client ibmmq-gskit ibmmq-jre ibmmq-runtime ibmmq-samples ibmmq-sdk ibmmq-server

This resolves the dependency for you.

Because you updated the apt repository with the IBM_MQ.list file, you may want to keep the files in the MQServer directory.

Finally.

Before you go, use dpkg-query -l “ibmmq*” to check you have installed all of the components you need, and they are at the right level.

You might need to issue


Good housekeeping

When you know you will not be going back to an earlier release, you can delete the files in the MQServerxx directory, and unwanted *.gz files. You may need to use chmod -R 777 MQServerxx because some files are read only, and prompt at delete time.

Check to see what is installed using dpkg-query -l “ibmmq*”  (Check the double quotes if doing cut and paste)

Remove the old files from apt using sudo apt remove “ibmmq-…”

If you updated a file in /etc/apt/sources.list.d, remove the old entry, and use sudo apt update to update the apt cache.