Use full solution for CentOSyum source

Source: Internet
Author: User
In our daily use, we may need to modify the YUM source for network reasons. One is to modify the network source, and the other is to modify the local source. /Etc/yum. repos. d/CentOS-Base.repo # network source modification/etc/yum. repos. d/CentOS-Meida.repo # Local source modification 1.1

In our daily use, we may need to modify the YUM source for network reasons.
One is to modify the network source, and the other is to modify the local source.
Are:/etc/yum. repos. d/CentOS-Base.repo # network source modification
/Etc/yum. repos. d/CentOS-Meida.repo # Local source modification
1.

1
Vi /etc/yum.repos.d/CentOS-Base.reop

123456
[base]name=CentOS-$releasever - Basemirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

For example, to change the source to 163, then change the http://mirrorlist.centos.org/to the http://mirrorlist.163.com/
2.
1
Vi /etc/yum.repos.d/CentOS-Media.repo

1234567
[c6-media]name=CentOS-$releasever - Mediabaseurl=file:///media/CentOS/        file:///media/cdrom/        file:///media/cdrecorder/gpgcheck=1enabled=0

Baseurl = file: // mnt/iso/modified/
Use NFS to mount the disc image, directly use the disc, or other devices.
PS: by default, YUM searches for source files in the/etc/yum. repos. d/directory. If you don't want to use YUM all the time to add parameters to the source, back up all the repo files in this directory to other directories. Then COPY a COPY of the content for use.
For example:
123
mkdir /etc/yum.repos.d/bak mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak/ cat /etc/yum.repos.d/bak/CentOS-Meida.repo

C6-media
Name = CentOS-$ releasever-Media
Baseurl = file: // mnt/iso/
Gpgcheck = 1
Enabled = 1 pay attention to the red part

12345
Yum clean all clear YUM cache yum grouplist view installable component yum install installation package yum groupinstall installation package yum remove uninstall a package
 

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.