我是靠谱客的博主 甜美口红,最近开发中收集的这篇文章主要介绍CentOS 7更新yum源CentOS 7更新yum源,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

CentOS 7更新yum源

1、备份并编辑CentOS-Base.repo

cd /etc/yum.repos.d 
cp CentOS-Base.repo CentOS-Base.repo.bak
vi CentOS-Base.repo

2、写入CentOS-Base.repo的内容

这里配置的是网易的镜像源

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#released updates 
[updates]
name=CentOS-$releasever - Updates 
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras 
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus 
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib 
#mirrorlist=http://mirrorlist.centos.org/?release=releasever$&arch=$basearch&repo=contrib
baseurl=http://mirrors.163.com/centos/7/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

3、更新yum源

yum clean all
yum makecache

报错:

curl#60 - "Peer's Certificate has expired."

原因:

未同步时间戳,系统视为不安全

4、Centos7安装ntpdate

wget http://mirror.centos.org/centos/7/os/x86_64/Packages/ntpdate-4.2.6p5-29.el7.centos.2.x86_64.rpm
 
rpm -ivh ntpdate-4.2.6p5-29.el7.centos.2.x86_64.rpm

最后

以上就是甜美口红为你收集整理的CentOS 7更新yum源CentOS 7更新yum源的全部内容,希望文章能够帮你解决CentOS 7更新yum源CentOS 7更新yum源所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(64)

评论列表共有 0 条评论

立即
投稿
返回
顶部