You can install MQ in its own unique directory by following the instructions here: https://www.ibm.com/docs/en/ibm-mq/9.4.x?topic=imlur-installing-additional-mq-installations-linux-using-rpm-command
Then when you are ready at some point later, you can move your queue managers, individually, one at a time, when they need to change, over to the new installation by using the setmqm command. Read more about this process here: https://www.ibm.com/docs/en/ibm-mq/9.4.x?topic=installations-associating-queue-manager-installation
If you're not used to having two (or more) installations on your machine, remember that you will have to run setmqinst in your command window to ensure the commands you want to run are using the appropriate binaries for the installation the queue manager you are targeting is associated with. With practice this becomes a habit. You can set the most frequently used one to be the primary if you need to.
Cheers,
Morag