Redhat7.5 使用aliyun的yum源以及 epel源

因工作需要現在用的系統換成Redhat7.5了,記錄下Redhat7.5更換成centos的yum源過程
1.首先刪除redhat原有的yum ,因爲redhat 原本的yum 沒有註冊爲redhat用戶是用不了的。
rpm -aq|grep yum|xargs rpm -e --nodeps
2.下載aliyun的yum 安裝包
wget mirrors.aliyun.com/centos/7.5.1804/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget mirrors.aliyun.com/centos/7.5.1804/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm
wget mirrors.aliyun.com/centos/7.5.1804/os/x86_64/Packages/yum-3.4.3-158.el7.centos.noarch.rpm
wget mirrors.aliyun.com/centos/7.5.1804/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget mirrors.aliyun.com/centos/7.5.1804/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
3.進行安裝yum
rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm
rpm -ivh python-urlgrabber-3.10-8.el7.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh yum-3.4.3-158.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-45.el7.noarch.rpm
4.創建repo文件
vi rhel-debuginfo.repo
在文件中寫入

[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.aliyun.com/centos/7.5.1804/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/7.5.1804/os/x86_64/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.aliyun.com/centos/7.5.1804/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/7.5.1804/os/x86_64/RPM-GPG-KEY-CentOS-7

[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.aliyun.com/centos/7.5.1804/extras//$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/7.5.1804/os/x86_64/RPM-GPG-KEY-CentOS-7

[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.aliyun.com/centos/7.5.1804/centosplus//$basearch/
gpgcheck=1
enabled=0
BashCopy
5.清除緩存並更新
yum clean all
yum update
6.安裝epel
yum install epel-release

文章轉載自 https://www.pjin.cn/linux/Redhat7-yum.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章