如何修改yum源,yum源修改有什么用

  • 编辑: 佼瑰
  • 2019-11-15 08:44:33
  • 人阅读
centos7修改yum源,可通过yum或up2date等步骤安装或更新最新版本的最新版本,则更新源的源地址不稳定,因此需要修改更新的源地址。使用yum或up2date,更新源配置文件。/ETlinux修改yum源地址

平时在安装或更新CentOS软件时,yum方式是最简单方便的,而系统默认到yum更新源地址不稳定,所以需要对更新源地址进行修改,国内一般用163比较快。

yum更新源配置文件:/etc/yum.repos.d/CentOS-Base.repo

1. 在修改前先备份该文件

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

2. 修改更新源配置文件(CentOS6地址,win7装机版,其他版本类似)

vim打开配置文件:

vim /etc/yum.repos.d/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

baseurl=http://mirrors.oschina.com/centos/$releasever/os/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

[updates]

name=CentOS-$releasever - Updates

baseurl=http://mirrors.oschina.com/centos/$releasever/updates/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

[addons]

name=CentOS-$releasever - Addons

baseurl=http://mirrors.oschina.com/centos/$releasever/addons/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

[extras]

name=CentOS-$releasever - Extras

baseurl=http://mirrors.oschina.com/centos/$releasever/extras/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

[centosplus]

name=CentOS-$releasever - Plus

baseurl=http://mirrors.oschina.com/centos/$releasever/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

最后保存配置文件。

3. 更新yum源配置

yum update

(如果不愿更新软件,选择N即可)

RedHat 6.2 Linux修改yum源免费使用CentOS源

配置EPEL YUM源

Redhat 本地yum源配置

yum的配置文件说明

RedHat 6.1下安装yum(图文)

YUM 安装及清理

CentOS 6.4上搭建yum本地源

以上就是电脑技术吧给大家介绍的如何使用CentOS修改yum更新源的方法了,如何使用CentOS修改yum更新源的方法到这里也全部结束了相信大家对如何使用CentOS修改yum更新源的方法都有一定的了解了吧,好了,如果大家还想了解更多的资讯,那就赶紧点击电脑技术吧系统官网吧。

本文原标题:修改yum源,修改yum源为本地源

版权声明:本文由 佼瑰 整理编辑,如果侵权请联系我们!

转载注明出处:https://www.nintaus.net/houtai@123/makehtml_archives_action.php?endid=0&startid=0&typeid=0&totalnum=11732&startdd=9220&pagesize=20&seltime=0&sstime=1589370344&stime=&etime=&uptype=mkall&mkvalue=0&isremote=0&serviterm=

文章评论

共有 条评论来说两句吧...

用户名:

验证码:

Top