Several methods of configuring Yum source for Redhat system and CentOS system

Source: Internet
Author: User
Tags yum repolist aliyun

Red Hat or CentOS system configuration Yum Source

Local Configuration Yum Source: CD-ROM storage, ISO warehouse (generally applicable to Red Hat Linux, (because it does not match or how to collect money) or no networked CentOS system,

(All are well-equipped network sources, as long as the internet can be used for Yum operation))

Document with picture link http://pan.baidu.com/s/1c2G6Xyg (Https://yunpan.cn/Oc6mzj4mLwgDzC access password d35c)

One, the virtual machine has the optical drive (the location of the CD in the virtual machine) mount the situation:

(1) Find the location of the optical drive (double-click the optical drive, the mouse on the CD-ROM will show the location of the CD-ROM, usually under the /run/media/ user name (root, etc.)

If the virtual machine is not set up

Because the optical drive is already mounted, simply write the next configuration file (suffix. Repo) in the/ETC/REPOS.D directory.

#查看文件

#或vi edit . Repo is a fixed file suffix

#因为是本地源所以是file://+ Optical Drive Absolute path

#是否启用源 1 Enable 0 non-enabled

#值1 The GPG check 0 does not proceed

[Email protected]/]# CD/ETC/YUM.REPOS.D

[[email protected] YUM.REPOS.D] #ll [[email protected] YUM.REPOS.D] #vim Dvd.repo

[DVD]

Name=dvd

baseurl=file://"/run/media/root/rhel-7.1 server.x86_64/"

Enabled=1

Gpgcheck=0

Exit Save

[[email protected] yum.repos.d]# yum Clean all # empty cache

[email protected] yum.repos.d]# Yum repolist #重新加载库

[email protected] yum.repos.d]# Yum repolist all #查看您拥有的仓库

Status is enable:4,371 indicates that the configuration is successful and then it can be installed with Yum

Second, use the. ISO system to mirror the composition source

(If you don't have an. iso file at the beginning, you can make one yourself as follows)

[email protected]/]# DD If=/dev/cdrom of=/mnt/rhel.iso

/dev/cdrom (a soft connection to/DEV/SR0) system optical Drive

Create a mount point, write the file (the mount point in BaseURL here) and mount it locally (-O-loop). ISO (format:-t iso9660) file

[Email protected]/]# MKDIR/MEDIA/DVD2

[Email protected] yum.repos.d]# vim Dvd2.repo

[DVD2]

Name=dvd2

Baseurl=file:///media/dvd2

Enabled=1

Gpgcheck=0

[Email protected] yum.repos.d]# mount-t iso9660-o loop/mnt/rhel.iso/media/dvd2

Set boot from boot under/etc/fstab (static information for the file system)

[Email protected] yum.repos.d]# Vim/etc/fstab

Add on last line

/mnt/rhel.iso/media/dvd2 iso9660 Loop 0 0

Quit and save it for a moment,

[[email protected] yum.repos.d]# mount-a #自动挂载/etc/fstab File system

Add Yum Network Source (mirrors.aliyun.com) (if you can connect to the Internet)

Directly configure the . Repo File

[Email protected] yum.repos.d]# vim Epel.repo

[Epel]

Name=epel

baseurl=http://mirrors.aliyun.com/epel/7server/x86_64/

Enabled=1

Gpgcheck=0

Of course you can also choose other network sources.

Exit save, Yum Repolist all to see if Yum update updates

Configuration is complete.

Several methods of configuring Yum source for Redhat system and CentOS system

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.