一、下载插件或者其他失败
当下载插件或者某些东西的时候,会出现如下方的情况:
想成功下载,解决该问题,则需要修改镜像(这里以阿里云镜像为例):
第一步:备份现有的 yum 源配置文件
# 进入yum源配置目录
cd /etc/yum.repos.d/
# 创建备份文件夹
mkdir backup
# 移动所有现有的repo文件到备份文件夹
mv *.repo backup/
第二步:下载阿里云镜像
# 下载阿里云为您准备好的CentOS 7 Vault源配置文件
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-7.9.2009.repo
下载完之后,该目录下会出现一个CentOS-Base.repo文件,然后编辑这个文件内容
第三步:编辑文件
进入该文件
vi CentOS-Base.repo
把下面的东西全部复制到CentOS-Base.repo文件中,把原来文件的东西都删除
# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist does not work for you, you can try the commented out # baseurl line instead. # [base] name=CentOS-$releasever - Base baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/os/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/updates/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/extras/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #additional packages that extend existing software [centosplus] name=CentOS-$releasever - Plus baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/centosplus/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
第四步:清理缓存并生成新的缓存
# 清除所有旧的缓存
yum clean all
# 为新源创建缓存
yum makecache
# 可选:更新所有已安装的包(如果需要)
# yum update -y
完成以上步骤,就可以成功安装了
评论0
暂时没有评论