Linux to build local yum warehouse by mounting system CD-ROM _linux

Source: Internet
Author: User
Tags gpg

1. Mount CD

[Root@localhost ~]# mount/dev/cdrom/media/cdrom/
Mount:/dev/sr0 write-protected, will be mounted as read-only

The CDROM directory under/dev is created in advance.

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

[Root@localhost/]# cd/etc/yum.repos.d/[root@localhost yum.repos.d]# mkdir bak #创建一个文件夹来存放多余的配置文件 [root@localhost yu m.repos.d]# mv *.* bak/[root@localhost yum.repos.d]# cd bak/[root@localhost bak]# ls Centos-base.repo CentOS-Debug Info.repo Centos-media.repo Centos-vault.repo centos-cr.repo Centos-fasttrack.repo CentOS-Sources.repo [ Root@localhost bak]# MV Centos-media.repo. /[Root@localhost bak]# CD ... /[Root@localhost yum.repos.d]# VI Centos-media.repo # centos-media.repo # This repo can is used with mounted DVD Media , verify the mount point for # CentOS-7.
You can use this repo and yum to install items directly off the # DVD ISO so we release. # To use this repo, put on your DVD and use it with the other repos too: # yum--enablerepo=c7-media [command] # # or FO R only the media repo, does this: # # yum--disablerepo=\*--enablerepo=c7-media [command] [C7-media] name=centos-$releaseve R-media baseurl=file:///media/centos/file:///media/cdrom/#本地yum源所在路径 file:///media/cdrecorder/gpgcheck=0 #这里为0不进行检查 enabled=1 #这里为1 start gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7 ~  

Save exit

3. Verify

We can view the warehouse using the Yum command plus the list parameter.

[Root@localhost/]# yum list #后面东西太多了 ...

The above is a small set to introduce Linux through the mounting system CD-ROM to build local Yum warehouse method, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.