How Linux builds local yum warehouses by mounting the system CD

Source: Internet
Author: User
Tags gpg

1. Mount the disc

Mount /dev/cdrom/media/cdrom/Mount:/dev/sr0 write-protected, mount as read-only

The CDROM directory under/dev is created in advance

2. Modify Yum configuration file (file location:/ETC/YUM.REPOS.D)

[Email protected]/]# cd/etc/Yum. repos.d/[[Email protected]Yum. repos.d]#mkdirbak #创建一个文件夹来存放多余的配置文件 [[email protected]Yum. repos.d]#MV* * bak/[[Email protected]Yum. repos.d]# CD bak/[email protected] bak]#lsCentOS-base.repo Centos-debuginfo.repo Centos-media.repo centos-Vault.repocentos-cr.repo Centos-fasttrack.repo centos-Sources.repo[[email protected] bak]#MVCentos-media.repo. /[email protected] bak]# CD ./[[Email protected]Yum. repos.d]#VICentos-media.repo
# centos-media.repo## This repo can is used with mounted DVD Media, verify theMountPoint for# CentOS-7. can use this repo andYumToInstallitems directly off the# DVD ISO that we release.## to use this repo, putinchyour DVD and use it with the other repos too:#Yum--enablerepo=c7-Media [command]## or forOnly the media repo, Dothis:##Yum--disablerepo=\*--enablerepo=c7-Media [Command][c7-Media]name=centos-$releasever-Mediabaseurl=file:///media/centos/        file:///media/cdrom/#本地yum源所在路径        file:///media/cdrecorder/gpgcheck=0 #这里为0不进行检查enabled=1 #这里为1 StartGpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7~

Save exit

3. Verification

We can view the warehouse with the Yum command plus the list parameter

[email protected]/]# Yum list  #后面东西太多了 ...                           

How Linux builds local yum warehouses by mounting the system CD

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.