Issue
I know for sure that yum does not support regular expression on its install commands but I wonder if there is a way to simulate it and have a single command that does:
Usually the regex for this would be python[2]?-foo
. How to do this with only yum?
Solution
I found a way to obtain a similar kind of behaviour using
yum -y --exclude='python3*' install python*-foo
This method allows you to avoid installing other python versions than the desired ones. May not be perfect but it did the job in my case.
Answered By - sorin Answer Checked By - Clifford M. (WPSolving Volunteer)