# CentOS Mirror

# Introduction

CentOS (opens new window) is a popular community-driven Linux distribution renowned for its stability and reliability. It is highly compatible with Red Hat Enterprise Linux (RHEL).

# Backup Existing Configuration

sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

# Edit Configuration File

Use the following command to replace the software repository: (from TUNA (opens new window))

sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
         -e 's|^#baseurl=http://mirror.centos.org|baseurl=https://mirrors.sustech.edu.cn|g' \
         -i.bak \
         /etc/yum.repos.d/CentOS-*.repo

# Refresh Cache

sudo yum makecache