当前位置:首页 > 野生技术 > 正文内容

CentOS_7更改yum为国内源

七星2个月前 (03-04)野生技术105

[qixing@localhost ~]$ su

Password:

[root@localhost qixing]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

[root@localhost qixing]# vi /etc/yum.repos.d/CentOS-Base.repo

# 清华大学
[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

# 阿里云
[base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
        http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
        http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 

yum clean all  # 清除系统所有的yum缓存

yum makecache # 生成yum缓存

yum update -y


qixingbit.com|转载请声名出处

相关文章

寄存器详解

寄存器详解

What is 寄存器?寄存器的官方叫法有很多,Wiki 上面的叫法是 Processing Register, 也可以称为 CPU Register寄存器是 CPU 内部的构造,它主要用于信息的存储...

Ubuntu在运行gcc编译时报错的解决办法汇总

Q1:/usr/include/features.h:324:26: 致命错误: bits/predefs.h:没有那个文件或目.原因: 环境不完整, 通过下面指令来安装需要的环境.F:运行: sud...

关闭win自动更新

关闭win自动更新

前言:我是一个码农,好不容易码完代码,准备睡觉,电脑关不掉了,那个心烦啊 于是,就有了下文操作Windows旗子 加上 R,输入:services.msc,  回车,打开...

CentOS7_docker图形化汉化管理工具部署

CentOS7_docker图形化汉化管理工具部署

1. 更改国内yum源, 并update2. 下载docker依赖    yum install -y yum-utils device-mapper-persistent-dat...

从你输入网址到访问页面,浏览器-服务器做了什么

从你输入网址到访问页面,浏览器-服务器做了什么

 文章转载于igoro.com/archive/what-really-happens-when-you-navigate-to-a-url/ 作为一个学网络类的人,对于"...

mosh和cygwin的安装与使用

mosh和cygwin的安装与使用

前言:使用ssh连接我的Linux服务器时,老是会断开,所以决定用mosh.我本地的电脑是windows10所以需要安装cygwin来支持Linux上的mosh客户端.cygwin的安装下载如下安装包...

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。