How the local image is used as a Yum source

Source: Internet
Author: User

The default yum is installed on the network, It is very painful to install the software through Yum without a network or poor speed. In fact, for Centosdvd , the software is sufficient to meet our needs, and The software version of the DVD is stable version, download speed is fast, for learning CentOS , the Centosdvd as the default yum source can greatly improve the learning efficiency.

1. Create a mount directory for the DVD

[[Email protected]~]# Mkdir/media/centos

2. Mount the Centosdvd under Linux ( virtual machine mount DVD not said, should be )

[Email protected]~]# mount-t Auto/dev/cdrom/media/centos

3, view the relevant configuration file, directory for

[Email protected]~]# ls-l/etc/yum.repos.d/

-rw-r--r--. 1 root root 1926 7 months 310:15 Centos-base.repo

-rw-r--r--. 1 root root 637 7 months 310:15 Centos-debuginfo.repo

-rw-r--r--. 1 root root 626 7 months 310:15 Centos-media.repo

4.Disable yum 's network update mode, simply rename the default preferred Centos-base.repo to Centos-base.repo.bak can

[[Email protected]]# mv Centos-base.repo Centos-base.repo.bak

5. Configure local yum source

[[Email protected]~]# Vim/etc/yum.repos.d/centos-media.repo

Will

[C6-media]

name=centos-$releasever-media

baseurl=file:///media/centos/

file:///media/cdrom/

file:///media/cdrecorder/

Gpgcheck=1

Enabled=0

Revision changed to

[C6-media]

name=centos-$releasever-media

baseurl=file:///media/centos/

Gpgcheck=1

Enabled=1

where baseurl changes to The Mount directory of the DVD,enabled=1 turn on local update mode

: Wq Save Exit

6. Clear the original yum information

[Email protected]~]# yum Clean all

Loadedplugins:fastestmirror

Cleaningup everything

7. Check the DVD software list

[Email protected]]# yum List

Loadedplugins:fastestmirror

Determiningfastest Mirrors

C6-media | 3.7 KB 00:00 ...

c6-media/primary_db | 3.3 MB 00:00 ...

This will be the default use of DVD installation software, if you want to restore the network installation mode, the centos-base.repo.bak renamed to restore.

PS. each time you restart the system, you need to mount the DVD manually to /media/centos/, and if you are bothered, you can automatically mount it by writing your own script.

How the local image is used as a Yum source

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.