Uninstalling or modifying IBM MQ on Linux using rpm
On Linux, we can uninstall the IBM MQ server or client using the rpm command. We can also modify an installation by removing selected packages (components) currently installed on the system.
Before starting
If we have applied one or more fix packs to the version of IBM MQ that we want to uninstall, we need to remove the fix packs in reverse chronological installation order before you remove the base packages.
We must remove any updates before starting the uninstallation procedure. For more information, see Restoring the previous maintenance level on IBM MQ on Linux .Attention: If we are installing replicated data queue managers (RDQM) use the supplied RDQM install scripts. For more information see installing RDQM. Important: We must stop all IBM MQ queue managers, other objects, and applications, before you begin the process to uninstall or modify IBM MQ.
Procedure
- Stop all IBM MQ applications associated with the installation we are uninstalling or modifying, if you have not already done so.
- For a server installation, end any IBM MQ activity associated with the installation we are uninstalling or modifying:
- Log in as a user in the group mqm.
- Set up the environment to work with the installation we want to uninstall or modify. Enter the following command:
. MQ_INSTALLATION_PATH/bin/setmqenv -swhere MQ_INSTALLATION_PATH refers to the location where IBM MQ is installed.- Display the state of all queue managers on the system. Enter the following command:
dspmq -o installation- Stop all running queue managers associated with the installation we want to uninstall or modify. Enter the following command for each queue manager:
endmqm QMgrName- Stop any listeners associated with the queue managers. Enter the following command for each queue manager:
endmqlsr -m QMgrName
- Log in as root.
- Uninstall or modify IBM MQ using the rpm command:
- On a system with a single installation:
- Find out the names of the packages (components) currently installed on the system, by entering the following command:
rpm -qa | grep MQSeries- Remove all components by appending all the package names to the rpm command arguments. For example:
rpm -qa | grep MQSeries | xargs rpm -ev- Modify your installation by appending individual package names to the rpm command arguments. For example, to remove the runtime, Server and SDK components enter the following command:
rpm -ev MQSeriesRuntime MQSeriesServer MQSeriesSDK- If we are using Ubuntu, add the --force-debian attribute. For example, to remove the runtime, Server and SDK components enter the following command:
rpm --force-debian -ev MQSeriesRuntime MQSeriesServer MQSeriesSDK
- On a system with multiple installations:
- Find out the names of the packages (components) currently installed on the system, by entering the following command:
rpm -qa | grep suffixwhere suffix is the unique name given to the packages when crtmqpkg was run at installation time. suffix is included in each of the package names that belong to a particular installation.- Remove all components by appending all the package names to the rpm command arguments. For example, to remove all components from an installation with the suffix MQ80 enter the following command:
rpm -qa | grep '\<MQSeries.*MQ80\>' | xargs rpm -ev- Modify your installation by appending individual package names to the rpm command arguments. For example, to remove the runtime, Server and SDK components from an installation with the suffix MQ80 enter the following command:
rpm -ev MQSeriesRuntime-MQ80 MQSeriesServer-MQ80 MQSeriesSDK-MQ80- If we are using Ubuntu, add the --force-debian attribute. For example, to remove the runtime, Server and SDK components for an installation with the suffix MQ80, enter the following command:
rpm --force-debian -ev MQSeriesRuntime-MQ80 MQSeriesServer-MQ80 MQSeriesSDK-MQ80
Results
After uninstallation, certain files under the directory trees /var/mqm and /etc/opt/mqm are not removed. These files contain user data and remain so subsequent installations can reuse the data. Most of the remaining files contain text, such as INI files, error logs, and FDC files. The directory tree /var/mqm/shared contains files that are shared across installations, including the executable shared libraries libmqzsd.so and libmqzsd_r.so.
What to do next
- If the product successfully uninstalled, we can delete any files and directories contained in the installation directory.
- If there are no other IBM MQ installations on the system, and we are not planning to reinstall or migrate, we can delete the /var/mqm and /etc/opt/mqm directory trees, including the files libmqzsd.so and libmqzsd_r.so. Deleting these directories destroys all queue managers and their associated data.
Parent topic: Uninstalling or modifying IBM MQ on Linux