华为源、本地源【需要挂载】
[local]
name=my repo
enabled=1
gpgcheck=0
baseurl=file:///mnt
[guanfang]
name=guan fang
enabled=1
gpgcheck=0
baseurl=https://repo.huaweicloud.com/centos/7.9.2009/os/x86_64/
[epel]
name=epel
enabled=1
gpgcheck=0
baseurl=https://repo.huaweicloud.com/epel/7Server/x86_64/
yum安装报错repodata/repomd.xml: [Errno 14] curl#6 - “Could not resolve host: mirrors.cloud.aliyuncs.com解决方案
1.1 删除老旧仓库
rm -rf /etc/yum.repos.d/*
1.2 卸载yum包
rpm -qa yum
rpm -e yum-3.4.3-168.el7.centos.noarch
卸载安装组件
rpm -qa | grep yum | xargs rpm -e --nodeps
检查
rpm -qa yum
1.3 下载最新的rpm安装包
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
1.4 安装yum
rpm -ivh yum-*
1.5 导入证书
rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
1.6 添加阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
1.7 清除旧缓存,生成新缓存
yum clean all
yum makecache
1.8 检查yum源是否正常
yum repolist