How Linux builds local yum warehouses by mounting the system CD

Source: Internet
Author: User
Tags gpg

1. Mount the disc

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

The CDROM directory under/media 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]# mkdir bak #创建一个文件夹来存放多余的配置文件 [[Email Protect ED] 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-media.repo## This  repo can is used with mounted DVD Media, verify the mount point for#  CentOS-7.  You can use the this repo and the Yum to install items directly off the#  DVD ISO then we release.## to use this repo, put in Y Our DVDs and use it with the other repos too:#  yum--enablerepo=c7-media [command]## or for-the media repo, do thi s:##  yum--disablerepo=\*--enablerepo=c7-media [command][c7-media]name=centos-$releasever-mediabaseurl=file :///media/centos/        file:///media/cdrom/#本地yum源所在路径        file:///media/cdrecorder/gpgcheck=0   # Here for 0 do not check enabled=1 #这里为1 start gpgkey=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

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.