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

CentOS_7更改yum为国内源

七星8个月前 (03-04)野生技术416

[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

相关文章

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

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

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

mosh和cygwin的安装与使用

mosh和cygwin的安装与使用

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

寄存器详解

寄存器详解

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

关闭win自动更新

关闭win自动更新

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

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

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

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

为什么32位系统最大只支持4G内存

为什么32位系统最大只支持4G内存

CPU概述上一节讲了寄存器, 这节讲讲CPU.CPU的发展史其他地方一大把, 这就不讲了,目前PC最常见的CPU是两家巨头, 英特尔(Intel)和AMD.可以说是这两家垄断了CPU市场.而从位数来说...

发表评论

访客

看不清,换一张

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