CentOS "yum update" URL not found 404

    • CentOS "yum update" URL not found 404

      When CentOS does a major release (e.g. from 6 to 7) and eventually after some time the "yum update" process will fail. Because they updates their repository URL from major.minor (e.g. 6.5) version to just a major (6).

      So their repository URL would change something from "http://mirror.centos.org/centos/6.5/os/x86_64/" to "http://mirror.centos.org/centos/6/os/x86_64/".

      The variable $releasever in /etc/yum.repos.d/CentOS-Base.repo still references to 6.5 and will break.

      Just simply replace that variable with the major release version like "6".

      Following command would do:

      Source Code

      1. cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bkup
      2. sed -ie "s/\$releasever/6/g" /etc/yum.repos.d/CentOS-Base.repo
      I like cars and taking pictures! 8)