Post

RHEL6.5更换yum源

学校发的candece虚拟机为RHEL6.5,将yum源更换为centos6.5源

更换 EPL 源 wget -O /etc/yum. Repos. D/epel. Repo https://mirrors.aliyun.com/repo/epel-archive-6.repo

更换 centos 源

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mv /etc/yum. Repos. D/CentOS-Base. Repo /etc/yum. Repos. D/CentOS-Base. Repo. Backup

wget --no-check-certificate -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo

sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo

sed -i  's/http/https/g' /etc/yum.repos.d/CentOS-Base.repo

# 6.5 为版本号
cat cat /etc/redhat-release ## Red Hat Enterprise Linux Server release 6.5 (Santiago)

sed -i  's/$releasever/6.5/g' /etc/yum.repos.d/CentOS-Base.repo

sed -i  's/centos/centos-vault/g' /etc/yum.repos.d/CentOS-Base.repo

yum clean all && yum makecache