Building a Centos/RHEL image on a Ubuntu OS fails with `Use of rpm to install X is no longer supported`
Symptoms
You have ran make build-devserver or make build-advancedserver on a ubuntu machine with a base image that is not ubuntu.
Your build fails and you see the following error in the install-mq.sh output
+ /tmp/mq/MQServer/mqlicense.sh -text_only -accept
Licensed Materials - Property of IBM
5724-H72
(C) Copyright IBM Corporation 1993, 2018
US Government Users Restricted Rights - Use, duplication or disclosure
restricted by GSA ADP Schedule Contract with IBM Corp.
WARNING: Unable to determine distribution and release for this system.
Check that it is supported before continuing with installation.
Agreement accepted: Proceed with install.
+ false
+ false
+ false
+ true
+ cd /tmp/mq/MQServer
+ rpm -ivh MQSeriesRuntime-9.1.0-0.x86_64.rpm MQSeriesSDK-9.1.0-0.x86_64.rpm MQSeriesSamples-9.1.0-0.x86_64.rpm
Preparing... ########################################
ERROR: Use of rpm to install MQSeriesRuntime on the Ubuntu distribution is no longer supported
Installation terminated
error: %pre(MQSeriesRuntime-9.1.0-0.x86_64) scriptlet failed, exit status 255
error: MQSeriesRuntime-9.1.0-0.x86_64: install failed
ERROR: Use of rpm to install MQSeriesSDK on the Ubuntu distribution is no longer supported
Installation terminated
error: %pre(MQSeriesSDK-9.1.0-0.x86_64) scriptlet failed, exit status 255
error: MQSeriesSDK-9.1.0-0.x86_64: install failed
ERROR: Use of rpm to install MQSeriesSamples on the Ubuntu distribution is no longer supported
Installation terminated
error: %pre(MQSeriesSamples-9.1.0-0.x86_64) scriptlet failed, exit status 255
error: MQSeriesSamples-9.1.0-0.x86_64: install failed```
# Problem
MQ v9.1 added a verification check into install to make sure that on ubuntu machines apt was used to install MQ. If RPM is used on a ubuntu OS then the install will fail.
Because `uname -a` returns kernel os and version information the check incorrectly detects the container image as running a ubuntu OS and fails while trying to execute `rpm install`.
# Workaround
Ensure that when building this MQ image with a non-ubuntu base image you use a non-ubuntu host.
# Solution
A fix to the MQ product will be delivered in the future that corrects this check.
sorry can you please advice if the is a way around this i just tried to install MQ 9.1 on linux ubuntu and getting the same problem using sudo rpm -ivh --force-debian --ignorearch MQSeries*.rpm on My oracle VM which is running Ubuntu
i tried reading the recommendation above but not understanding what needed to overcome this
Hi @Roligucci - This issue describes a problem that users will encounter when trying to build the IBM MQ 9.1 Container image.
From what you've described it looks like you're trying to just install IBM MQ 9.1 on a Virtual machine. A change was made in 9.1 to enforce using debian install files on debian based operating systems. As you're using an Ubuntu OS you must use the debian install files to install IBM MQ. You can find instructions for installing IBM MQ 9.1 using debian install files here.
I'm little late to this, but I solved it faking temporarily uname output.
Basically, the installation is based in the value from /usr/bin/uname. I just put a shell script in this location, installed the RPM and rolled-back the uname to its original place.
RUN mv /usr/bin/uname /tmp/uname && \
echo '#!/bin/bash' > /usr/bin/uname && \
echo 'echo "Linux geeklab 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux"' >> /usr/bin/uname && \
chmod u+x /usr/bin/uname
RUN cd /root/MQServer && ./mqlicense.sh -accept && rpm -ivh MQSeriesServer-9.1.0-0.x86_64.rpm MQSeriesRuntime-9.1.0-0.x86_64.rpm
RUN mv /tmp/uname /usr/bin/uname
I'm having a similar issue. Trying to build a RHEL docker container that uses IBM MQ on an Ubuntu machine is failing with:
ERROR: Use of rpm to install MQSeriesSDK on the Ubuntu distribution is no longer supported
Installation terminated
error: %pre(MQSeriesSDK-9.1.0-0.x86_64) scriptlet failed, exit status 255
error: MQSeriesSDK-9.1.0-0.x86_64: install failed
This doesn't make sense to me, I'm installing into a RHEL container which uses rpm, so how could I possibly use any thing else?
@lockieRichter, did you try the steps I put in the last comment?
--
Of course it makes sense. Even if you're running a RHEL container, when you do uname -a inside the container, the kernel displayed will be from the host machine (in your case, Ubuntu). That's the way containers work, because they are not virtual machines, they're just isolated processes (try top and htop inside the container and you will see that you are not in a 'different virtual machine').
The problem here is that IBM MQ tries to guess the current system based on uname, and the workaround I put in the last command mislead IBM MQ to think that we're actually in a RPM-based distribution.
@juninho ahh I see what you're saying, I was getting mixed up between containers and VMs.
I did try your suggested steps but they did not work for me. I'm not 100% sure why, so might have to try again...
@lockieRichter, what exactly are you trying to do? What it is not working for you?
--
EDIT: sorry, my fault... You need to use geeklab instead of fakeuname.
Try again, please...
@juninho as I said, we are trying to build a RHEL container that uses IBM MQ and pymqi from an Ubuntu AWS server. When we try to build the docker image we get the message ERROR: Use of rpm to install MQSeriesRuntime on the Ubuntu distribution is no longer supported Installation terminated or something similar.
I resolved the issue by building the image on a different machine and copying over the network. Not ideal, but a solution for now.