Install GCC from the CD (Change Yum source)

Source: Internet
Author: User
Tags gpg

Here we will use a virtual machine demonstration and record it for future reference.

I. Attach a CD image

Load localBin-DVDMirror file to virtual machine system ,:

Ii. Change Yum Source

1Attach a CD image

For example, run the following command:

Mkdir test1

Mount/dev/CDROM test1

 

We can see that/Dev/CDROMMountedTest1Directory.

2, ModifyYumConfiguration File

YumThe configuration file directory of is:/Etc/yum. Repos. d/

The file to be modified here is:CentOS-Media.repo

The original file is as follows:

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

The field description is as follows:

Name: (Custom) Name

Baseurl: Search Path

Gpgcheck: Check?GPG-KEY,0Do not check,1For check

Enabled: Enabled or notYumSource,0Is not enabled,1To enable

We only needBaseurlAdd the directory where the CD is attached, that is:

3. Install software ( Gcc )

SearchGCC:

Yum-disablerepo = * enablerepo = c6-media search gcc

InstallGCC:

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

There are many methods. Here I just record one of them.

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.