We have the OS rhel8.2 and want to update to only rhel8.6 though while passing the releasever=8.6, still it is being updated to rhel8.7
what parameter we should use to upgrade to rhel8.6
If you are using Red Hat Satellite, you need to create a content view with the relevant repositories for RHEL8.6 , or a content view with filters by date so only the RHEL 8.6 packages are included.
If you are using the Red Hat CDN, you probably need to:
subscription-manager release --set 8.6
yum clean all
Then what are your yum repositories? What content is synchonized over there? How do you build those repositories?
Ideally your repos should only have RHEL 8.6 content. Otherwise there is no way to instruct yum in the clients to download RHEL 8.6 RPMs as yum does not have that informaiton.