来说问题先
今天想安装一下jump堡垒机,结果发现安装的时候直接报错,来个图片吧。
开始以为断网,然后接着排查一下。
1、查询本机IP地址,ping内外通讯正常。
2、检查了DNS,安装机器的网络设置和解析也正常
3、防火墙也进行了排查关闭,发现也是正常。
从网络上面诊断没问题,系统也是新的,那么大概率是yum仓库源的问题,开始更换仓库
先去看下原来的仓库
cd /etc/yum.repos.d/
ll
vi CentOS-Base.repo
里面的仓库源没猜错应该是官方的,把它换成阿里的。清华的作为备用
以下内容复制替换掉原来CentOS-Base.repo这个里面所有的。
# CentOS-Base.repo
#
# 这里配置了CentOS的yum源,使用了阿里云和清华大学的镜像点。
#
[base]
name=CentOS-$releasever – Base
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever – Updates
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
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=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever – Plus
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#contrib – packages by Centos Users
[contrib]
name=CentOS-$releasever – Contrib
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
# 使用failovermethod指定优先级,这里设置为随机(roundrobin),也可以改为priority并指定每个URL的优先级
failovermethod=roundrobin
最后清理一下缓存,按顺序依次输入即可。
sudo yum clean all
sudo yum makecache
sudo yum update
评论前必须登录!
立即登录 注册