Centos modify yum source

Source: Internet
Author: User
When I was learning linux, I didn't have a CD. to install software, I had to change the yum source on the Internet. Here we provide a NetEase yum source. 1. download the http://mirrors.163.com file to the centos help document for the CentOS6-Base-163.repo and store it in/etc/yum. repo. d. Centos6: wgethttp: // mirrors.163.com/

When I was learning linux, I didn't have a CD. to install software, I had to change the yum source on the Internet.

Here we provide a NetEase yum source.

1. download the http://mirrors.163.com file to the centos help document for the CentOS6-Base-163.repo and store it in/etc/yum. repo. d.

Centos 6: wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

Centos 5: wget http://mirrors.163.com/.help/CentOS5-Base-163.repo

Copy the downloaded file/etc/yum.repos.dDirectory.

2. First back up/etc/yum. repos. d/CentOS-Base-163.repo

 cp CentOS6-Base-163.repo CentOS6-Base-163.repo.bak 

3. edit the CentOS6-Base-163.repo file and change $ releasever to the centos version. here, redhat6.0 32-bit version is used as an example.

[root@Node2 yum.repos.d]# vi CentOS6-Base-163.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-6 - Base - 163.combaseurl=http://mirrors.163.com/centos/6/os/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#released updates[updates]name=CentOS-6 - Updates - 163.combaseurl=http://mirrors.163.com/centos/6/updates/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updatesgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#additional packages that may be useful[extras]name=CentOS-6 - Extras - 163.combaseurl=http://mirrors.163.com/centos/6/extras/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extrasgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages[centosplus]name=CentOS-6 - Plus - 163.combaseurl=http://mirrors.163.com/centos/6/centosplus/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplusgpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users[contrib]name=CentOS-6 - Contrib - 163.combaseurl=http://mirrors.163.com/centos/6/contrib/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contribgpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

4. Save the edited file and check whether the update is successful:

Yum clean all clear original cache yum makecache get yum list yum install vim *
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.