Reputation: 145
I have generated two RPMs. One for CentOS 6 and one for CentOS 7.
my-package-0.0.1-1.el6.x86_64
my-package-0.0.1-1.el7.x86_64
When I do a yum info my-package
on a CentOS 6 machine, it gives me the el7 information. When I do yum install my-package
it does the same, gets the el7 version. Why is it doing this? I'm trying to avoid installing a el7 version on a el6 machine.
Upvotes: 3
Views: 3473
Reputation: 6758
It sounds like you have them in the same yum repository. You shouldn't. You should be posting one to a CentOS6 repo and the other to a CentOS7 repo. Otherwise, yum
is comparing them and deciding that 7 > 6 when comparing the release tags, so therefore that's the newest package available.
The el6
(AKA "dist tag") is a convenience to the user as a suffix to the release, and is not something that RPM can select on directly.
Upvotes: 5
Reputation: 54583
Agreeing that apparently OP put both RPMs in the same repository, there are some details overlooked by @aaron-d-marasco:
el6
tag is not a "convenience to the user" but rather a workaround by packagers.if you check the meta information for the packages, you may notice that the .el6
(or .el7
) in the packages provided are appended to the release tag, e.g., for zip-3.0-10.el7.x86_64
, you might see something like this:
Name : zip
Version : 3.0
Release : 10.el7
Architecture: x86_64
the RPM selection rules use the whole tags for version and release for each name specified.
yum
.Further reading:
Upvotes: 4