19 September 2017

Enable Yum Repositories on CentOS

NB: This may break your install if they've been disabled for a reason e.g. on a bespoke Linux

If the yum repos containing the packages you need are disabled by default:
  1. Find the version of CentOS:
    cat /etc/issue
  2. List the installed repos:
    yum repolist all
  3. Enable the repository in the config file e.g.:
    1. Copy original:
      cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.orig
    2. Edit file:
      vi /etc/yum.repos.d/CentOS-Base.repo
    3. Initiate INSERT mode: i
    4. Make necessary changes in the first repo:
      Uncomment (remove #) from baseurl=http
      Replace centos/$releasever with the version e.g. centos/7.2.1511
      enabled=1
  4. Update the repositories:
    yum update
    1. Install yum-utils:
      yum install yum-utils

    No comments:

    Post a Comment