CentOS Settings Use local source

Source: Internet
Author: User
Tags gpg

1, installation Vm-tools

2, set the shared folder, I set the shared folder is E:\ProgramData name: ProgramData

3. Create Folder mkdir/media/centos/

4. Mount the ISO file

In CentOS, after setting up the file share, we can find a programdata/subdirectory in the/mnt/hgfs/directory, the CentOS ISO file is also in this directory, I share later, the ISO file in the CentOS path is

/mnt/hgfs/programdata/centos-6.3-x86_64-bin-dvd2.iso

Mount the image file to/media/centos/

[Email protected] yum.repos.d]# Mount-o loop /mnt/hgfs/programdata/centos-6.3-x86_64-bin-dvd2.iso/media/ centos/

5. Modify the configuration file

cd/etc/yum.repos.d/

[Email protected] yum.repos.d]# more Centos-media.repo
# Centos-media.repo
#
# This repo was used to mount the default locations for a CDROM/DVD on
# CentOS-6. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put on your DVD and use it with the other repos too:
# yum--enablerepo=c6-media [command]
#
# or for the media repo, does this:
#
# yum--disablerepo=\*--enablerepo=c6-media [command]
[C6-media]
name=centos-$releasever-media
baseurl=file:///media/centos/
file:///media/cdrom/
file:///media/cdrecorder/
Gpgcheck=1
Enabled=0
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-6

Where BaseURL is the parameter we need to modify, because we have already mounted the ISO image in the/media/centos/directory, so we don't need to modify it. Yum local source can be used.

6. Install the software using local Yum source

The method of using the local Yum source has been described in Centos-media.repo:

(4.1) In addition to using the local Yum source, other Yum sources will be used

Yum--enablerepo=c6-media [command]

(4.2) Just use local Yum source

Yum--disablerepo=/*--enablerepo=c6-media [command]

Here is the installation of MySQL with local Yum source

[email protected] yum.repos.d]# Yum--disablerepo=/*--enablerepo=c6-media Install Mysql-server

CentOS Settings Use local source

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.