近期,在用yum下载ntp的时候,无法下载,百度好多解决办法,不仅很复杂,而且基本无法解决。
一个很简单的方法就是直接换一个阿里的yum源。
一开始用yum的时候,出现如下问题:
百度很多方法都解决不了,简单粗暴,只需要换一个阿里的yum源就好了
进入/etc/yum.repos.d目录,然后把该目录的文件可以都删除,再新建一个文件(我建的是aliyun.repo)
vim aliyun.repo
然后将如下内容放进去
[aliyun_os]
name=aliyun_os
baseurl=https://mirrors.aliyun.com/centos/6/os/x86_64/
enabled=1
gpgcheck=0
[aliyun_extras]
name=aliyun_extras
baseurl=https://mirrors.aliyun.com/centos/6/extras/x86_64/
enabled=1
gpgcheck=0
[aliyun_epel]
name=aliyun_epel
baseurl=https://mirrors.aliyun.com/epel/6/x86_64/
enabled=1
gpgcheck=0
注意需要看你系统版本是6还7 ,修改上述内容对应6或7
修改好之后,保存,然后你的yum就可以用了。十分简单