How to Yum update to specific version if we want to install update, but not the latest package.
Sometimes we can not update to latest version and need some update packages step before the latest package.
For example on Gitlab-ce Package. We currently running on gitlab-ce-13.9.2-ce.0.el7.x86_64 and current latest Gitlab-ce is gitlab-ce-14.0.6-ce.0.el7.
When we want to update, there is an error.
Running transaction
gitlab preinstall: It seems you are upgrading from major version 13 to major version 14.
gitlab preinstall: It is required to upgrade to the latest 13.12.x version first before proceeding.
gitlab preinstall: Please follow the upgrade documentation at https://docs.gitlab.com/ee/update/index.html#upgrade-paths
error: %pre(gitlab-ce-14.0.6-ce.0.el7.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package gitlab-ce-14.0.6-ce.0.el7.x86_64
gitlab-ce-13.9.2-ce.0.el7.x86_64 was supposed to be removed but is not!
So we need to update Gitlab-ce to version gitlab-ce-13.12.8-ce.0.el7
Yum Update To Specific Version
First we need to list all package with command:
yum list "package name" --showduplicates
For example:
yum list gitlab-ce --showduplicates
Then update to specific package version
yum update "package name"-"version"
For Example
yum update gitlab-ce-13.12.8-ce.0.el7
If we want to update to the latest version, then we can update using this command
yum update gitlab-ce