CentOS 7.0 uses mirrored local Yum

Source: Internet
Author: User
Tags gpg

To mount the image first, I mount the path to/mnt

Then we'll start entering.

Cd/etc/yum.repos.d

Back up all the files first, so that you don't find them when you use them later.

Then delete all the source files

[[email protected] yum.repos.d]# ls

Centos-base.repo Centos-debuginfo.repo Centos-vault.repo

Centos-base.repo.bak Centos-sources.repo

[Email protected] yum.repos.d]# MV Centos-debuginfo.repo Centos-debuginfo.repo.bak

[Email protected] yum.repos.d]# MV Centos-vault.repo Centos-vault.repo.bak

[Email protected] yum.repos.d]# MV Centos-sources.repo Centos-sources.repo.bak

[Email protected] yum.repos.d]# RM-RF Centos-sources.repo Centos-debuginfo.repocentos-base.repo

[[email protected] yum.repos.d]# ls

Centos-base.repo Centos-sources.repo.bak

Centos-base.repo.bak Centos-vault.repo.bak

Centos-debuginfo.repo.bak

[Email protected] yum.repos.d]# rm-f Centos-base.repo

[Email protected] yum.repos.d]#

[Email protected] yum.repos.d]#

Create a new file and write the contents

[Email protected] yum.repos.d]# vim Centos-media.repo

[C7-media]

name=centos-$releasever-media

Baseurl=file:///mnt

Gpgcheck=0

Enabled=1

Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7

Next can install the service, do not need the network.

This article is from the "Pengjiawang" blog, make sure to keep this source http://pengjiawang.blog.51cto.com/10989721/1866956

CentOS 7.0 uses mirrored local Yum

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.