I'm trying to stop installation of an rpm if I have a particular version of a package already installed.
Say I have 2 packages A-7.1.1.rpm & Main_package-1.0.rpm to be installed.
And I've A-1.4.0.rpm already installed on the machine. So what I want to achieve is that, if the installed version of A < 7.1.0 then upgrade of Main_package should not happen.
I tried to put Conflicts tag in the spec file of Main_package as follows.
Conflicts : A < 7.1.0
And executed yum install *.rpm
Here yum finds a latest version of package 'A' in the directory (ie, A-7.1.1.rpm), it doesn't conflict. What I want to check is, if the machine has a particular version of package A.
I could not find any other tags that I can use within the spec file.
Is there any way I can achieve this?
Note: I can't have this check inside a script which then invokes yum install *.rpm
I can execute only yum install *.rpm, nothing else.
yum install; you say it doesn't conflict. Yum should allow installation of A-7.1.1, but not together with your main_package. Does yum allow installation of both together? You could check as well if the main_package has the correct conflicts tag set; usingrpm -qp /path/to/Main_package-1.0.rpm --conflicts- Chris Maes