www.2527.com_澳门新葡8455手机版_新京葡娱乐场网址_
做最好的网站

修改CentOS暗许yum源为国内yum镜像源,yum源更新设

2019-07-12 09:52 来源:未知

CentOS下能够通过yum很方便急速的装置所需的软件和库,假如yum的源不好,安装速度会那么些慢,CentOS 6.0默许官方源仿佛都是外国的,所以速度不能够确认保障,小编直接选择163的源,认为速度不错。上面就说说如何修改yum的源。

CentOS 修改yum源为国内源

CentOS暗中同意的yum源不是境内的yum源,在经过yum安装一些软件的时候,会并发那样那样的荒唐,以及在下载安装的快慢上也是那一个慢的。

 1、步向存放源配置的文本夹
cd /etc/yum.repos.d

CentOS 修改yum源为国内源

修改yum源的格局有三种,比非常多朋友喜欢修改yum.repos.d这几个文件进行更动,deepvps认为那个措施不是太好,以下那些艺术就便于多了。

在CentOS系统中,能够一贯通过yum来设置组件,但系统暗中认可的yum源速度往往适得其反,都接连国外的,为了在境内高达飞快安装的目标,将要需求修改yum源,能够动用

新京葡娱乐场网址, 那2个国内源。

进行以下命令就足以了

cd /etc/yum.repos.d
mv CentOS-Base.repo CentOS-Base.repo.bak
wget


wget

运转yum makecache生成缓存

搞定。

为此那个时候就须求将yum源替换来国内的yum源,国内第一开源的开源镜像站点应该是乐乎和Ali云了。上面分别记录替换未Ali云和网易的法子:

2、备份私下认可源
mv ./CentOS-Base.repo ./CentOS-Base.repo.bak

改造centos yum 成人中学中原人民共和国镜像加速yum速度

163的开源镜像地址
昔不近年来版本见

sohu的开源镜像地址
今非昔比版本见

中国科大
以后和过去很不佳别样版本见)

只要采纳上边YUM源的话,最佳把在那之中的mirrorlist注释掉,不然系统会运维fastesmirror插件自动物检疫查的,并不一定会选择那些yum源的.

本身用的是中国防农业学院的进程不错。

法一:直接下载源文件

CentOS USTC mirror 那个镜像不错,我们更新可用那一个

#yum -y install wget
#cd /etc/yum.repos.d
#mv CentOS-Base.repo CentOS-Base.repo.save
#wget

在意:假使为率先次安装的新连串来讲,则供给先安装wget这一个下载软件,不然没法下载CentOS-Base.repo这么些文件的。

法二:手动创设源文件

改动yum镜像站点为中华站点地址,推荐)

#cd /etc/yum.repos.d/

#mv CentOS-Base.repo CentOS-Base.repo.bak

#vi CentOS-Base.repo

修改/etc/yum.repos.d/CentOS-Base.repo如下:

一、修改CentOS默认yum源为mirrors.aliyun.com

1、首先备份系统自带的yum源配置文件     /etc/yum.repos.d/CentOS-Base.repo

# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、踏入yum源配置文件所在的公文夹

# cd /etc/yum.repos.d/

3、下载aliyun的yum源配置文件到/etc/yum.repos.d/

CentOS 7:

# wget -O /etc/yum.repos.d/CentOS-Base.repo 

CentOS 6:

# wget -O /etc/yum.repos.d/CentOS-Base.repo 

CentOS 5:

# wget -O /etc/yum.repos.d/CentOS-Base.repo 

4、运转yum makecache生成缓存

# yum makecache

5、更新系统

# yum -y update

 

3、使用wget下载163的源
wget

Centos镜像使用援救

二、修改CentOS默认yum源为mirrors.163.com

1、首先备份系统自带的yum源配置文件     /etc/yum.repos.d/CentOS-Base.repo

# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、步入yum源配置文件所在的文书夹

# cd /etc/yum.repos.d/

3、下载163的yum源配置文件到/etc/yum.repos.d/

CentOS 7:

# wget 

CentOS 6:

# wget 

CentOS 5:

# wget 

4、运转yum makecache生成缓存

# yum makecache

5、更新系统

# yum -y update

 

4、把下载下来的文书CentOS-Base-163.repo设置为私下认可源
mv CentOS-Base-163.repo CentOS-Base.repo

选定架构

  • i386
  • x86_64

Centos6.0的Centos-Base.repo下载
 

任用版本

  • 5
  • 6

新京葡娱乐场网址 1

利用验证

先是备份CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

下载对应版本的CentOS-Base.repo, 放入/etc/yum.repos.d/

这是CentOS 5的:

CentOS-Base.repo

# CentOS-Base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client.  You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead.##[base]name=CentOS-$releasever - Base - mirrors.ustc.edu.cnbaseurl=http://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osgpgcheck=1gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5#released updates [updates]name=CentOS-$releasever - Updates - mirrors.ustc.edu.cnbaseurl=http://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updatesgpgcheck=1gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5#additional packages that may be useful[extras]name=CentOS-$releasever - Extras - mirrors.ustc.edu.cnbaseurl=http://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extrasgpgcheck=1gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5#packages used/produced in the build but not released[addons]name=CentOS-$releasever - Addons - mirrors.ustc.edu.cnbaseurl=http://mirrors.ustc.edu.cn/centos/$releasever/addons/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addonsgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plus - mirrors.ustc.edu.cnbaseurl=http://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplusgpgcheck=1enabled=0gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5#contrib - packages by Centos Users[contrib]name=CentOS-$releasever - Contrib - mirrors.ustc.edu.cnbaseurl=http://mirrors.ustc.edu.cn/centos/$releasever/contrib/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contribgpgcheck=1enabled=0gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5

这是CentOS 6的:

CentOS-Base.repo

# CentOS-Base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client.  You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead.##[base]name=CentOS-$releasever - Base - mirrors.ustc.edu.cnbaseurl=http://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osgpgcheck=1gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6#released updates [updates]name=CentOS-$releasever - Updates - mirrors.ustc.edu.cnbaseurl=http://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updatesgpgcheck=1gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6#additional packages that may be useful[extras]name=CentOS-$releasever - Extras - mirrors.ustc.edu.cnbaseurl=http://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extrasgpgcheck=1gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plus - mirrors.ustc.edu.cnbaseurl=http://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplusgpgcheck=1enabled=0gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users[contrib]name=CentOS-$releasever - Contrib - mirrors.ustc.edu.cnbaseurl=http://mirrors.ustc.edu.cn/centos/$releasever/contrib/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contribgpgcheck=1enabled=0gpgkey=http://mirrors.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-6

运转yum makecache生成缓存

修改yum源为国内源 CentOS 修改yum源为国内源 修改yum源的主意有三种,相当多朋友喜欢修改yum.repos.d这一个文件实行改造,deepvps感到那么些方法...

TAG标签:
版权声明:本文由澳门新葡8455手机版发布于新京葡娱乐场网址,转载请注明出处:修改CentOS暗许yum源为国内yum镜像源,yum源更新设