redhat 7.6 替换Centos7.6 aliyun Yum

发布于 2019-08-02  653 次阅读


公司有个项目与北美合作,我给他在本地弄一台redhat7.6的服务器,但是老外说用不了yum,可能老外比较倾向付费的Redhat系统,然后我就用了阿里云的Centos Yum repo

1.把原来的yum 的rpm删除
列出yum rpm
rpm -qa | grep yum
删除yum rpm
rpm -qa|grep yum|xargs rpm -e --nodeps

2.下载rpm
因迷你版,无法使用wget ,所以只能用curl下载
curl -o yum-3.4.3-161.el7.centos.noarch.rpm https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
curl -o yum-metadata-parser-1.1.4-10.el7.x86_64.rpm https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
curl -o yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm https://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

3.安装rpm
rpm -ivh yum-*

4.重命名redhat源文件
mv /etc/yum.repos.d/redhat.repo /etc/yum.repos.d/redhat.repo.backup

5.配置Centos源文件
cd /etc/yum.repos.d
curl -o CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
vi Centos-7.repo
:%s/$releasever/7.6.1810/g
:wq

6.更新缓存
yum clean all
yum makecache


一沙一世界,一花一天堂。君掌盛无边,刹那成永恒。