Centos modify Yum update source

Source: Internet
Author: User
Tags gpg

 

1. Back up the file before modification

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

2. modify and update the source configuration file(Centos6 address, similar to other versions)

Vim open the configuration file:

vim /etc/yum.repos.d/CentOS-Base.repo

Copy and paste the following content to the configuration file:

# 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 - Basebaseurl=http://mirrors.oschina.com/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6[updates]name=CentOS-$releasever - Updatesbaseurl=http://mirrors.oschina.com/centos/$releasever/updates/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6[addons]name=CentOS-$releasever - Addonsbaseurl=http://mirrors.oschina.com/centos/$releasever/addons/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6[extras]name=CentOS-$releasever - Extrasbaseurl=http://mirrors.oschina.com/centos/$releasever/extras/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6[centosplus]name=CentOS-$releasever - Plusbaseurl=http://mirrors.oschina.com/centos/$releasever/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

Finally, save the configuration file.

3. Update Yum source configuration

yum update

(If you do not want to update the software, select n)

 

(Source: http://www.cnblogs.com/shockerli/p/3716893.html)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.