Centos 6: Change Yum source to local disk

Source: Internet
Author: User
Tags gpg

Yum sources are mainly divided into network and CD. The configuration file is stored in the/etc/yum. Repo. d directory.

Cat CentOS-Media.repo

# CentOS-Media.repo## This repo is used to mount the default locations for a CDROM / DVD on#  CentOS-5.  You can use this repo and yum to install items directly off the#  DVD ISO that we release.## To use this repo, put in your DVD and use it with the other repos too:#  yum --enablerepo=c5-media [command]#  # or for ONLY the media repo, do this:##  yum --disablerepo=\* --enablerepo=c5-media [command] [c6-media]name=CentOS-$releasever - Mediabaseurl=file:///media/CentOS/        file:///mnt/cdrom/        file:///media/cdrecorder/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

Indicates that Yum searches for/Media/centos/,/mnt/CDROM/, And/Media/cdrecorder.

After the disc is inserted, your disc name is displayed in the Meida directory. However, you can use ln instead of the above directories.

Ln-S/Media/disc name/Meida/centos

If the local ISO file is used.

Mkdir/Media/centos

Mount-o loop disc. ISO/Media/centos

 

After the configuration is complete, you can update the software.

Yum -- disablerepo = * -- enablerepo = c6-media install ****

To update the software.

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.