Skip to content

How to force yum to update only to exact minor OS version

I have a default AWS image with the version CentOS 6.7. If I run

yum update

I am getting CentOS 6.9.

Is there any way to force yum to update only to version 6.8 and not 6.9?



Yes it is possible. Follow these steps:

  • Find a mirror that is closer to you using:
  • Replace 6.9 with 6.8, e.g., the URL would look like:
  • Create a yum repo file in /etc/yum.repos.d. Let’s name the file User-Stepped.repo.

  • Content of the file would look like the following:

    ~]# cat /etc/yum.repos.d/User-Stepped.repo
    name=A stepped repo - CentOS 6.8
  • Execute the following command to update to CentOS 6.8

    ~]# yum clean all
    ~]# yum --disablerepo='*' --enablerepo=User_Stepped update

Use the same name in --enablerepo as you used inside the square brackets of the User-Stepped.repo file.