Linux steps to configure local yum source, configure domestic yum source, and configure epel source

Linux steps to configure local yum source, configure domestic yum source, and configure epel source

1. Configure local yum source

1. Mount the ISO image

mount -o loop /mnt/yum-iso/CentOS-7-x86_64-DVD-1611.iso /mnt/cdrom

2. Configure yum source file

#iso.repo must end with .repo[root@node5 ~]# cat /etc/yum.repos.d/iso.repo 
[iso]
name=iso
baseurl=file:///mnt/cdrom
enable=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#Clear all yum caches in the system [root@node5 yum.repos.d]# yum clean all

#Generate yum cache [root@node5 yum.repos.d]# yum makecache


#Notes:
[iso] #The name of the yum source, which is unique on this server and is used to distinguish different yum sources			
name= iso #Description of yum source baseurl=file:///mnt/cdrom #The path of yum source can also be FTP (ftp://...), HTTP (http://...), local (file:///the location of the CD-ROM mount directory)
enabled=1 #1 means enabling the yum source; 0 means disabling gpgcheck=0 #1 means using the public key to verify the correctness of the rpm package; 0 means not verifying gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 #Specify the public key file address for rpm verification

3. Set the system to automatically mount the iso image file at startup

#In the /etc/fstab file, add [root@node5 ~] to the last line# cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/mnt/yum-iso/CentOS-7-x86_64-DVD-1611.iso /mnt/cdrom iso9660 loop 0 0

2. Configure domestic yum source and epel source

1. First back up the original repo file

[root@node5 ~]# cd /etc/yum.repos.d/
[root@node5 yum.repos.d]# mkdir repo_bak
[root@node5 yum.repos.d]# mv *.repo repo_bak/
[root@node5 yum.repos.d]# ls
repo_bak

2. Download the repo file provided by the domestic mirror

[root@node5 yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repo
[root@node5 yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@node5 yum.repos.d]# ls
CentOS7-Base-163.repo Centos-7.repo repo_bak

#Note: There is a sentence in the Centos-7.repo file: baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
#$releasever indicates the system version number. You can use cat /etc/centos-release to view the version number. #[root@node5 yum.repos.d]# cat /etc/centos-release
#CentOS Linux release 7.4.1708 (Core)
#$basearch indicates the processor type, such as x86_64

#Clear all yum caches in the system [root@node5 yum.repos.d]# yum clean all

#Generate yum cache [root@node5 yum.repos.d]# yum makecache

3. Install the epel source

#Install the official epel source [root@node5 yum.repos.d]# yum install -y epel-release

[root@node5 yum.repos.d]# ls
CentOS7-Base-163.repo Centos-7.repo epel.repo epel-testing.repo repo_bak

#Install Alibaba's epel source [root@node5 yum.repos.d]# wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo

[root@node5 yum.repos.d]# yum clean all

[root@node5 yum.repos.d]# yum makecache

4. View the yum sources and all yum sources available in the system

[root@node5 yum.repos.d]# yum repolist enabled

[root@node5 yum.repos.d]# yum repolist all

The above are the details of the steps to configure local yum source, domestic yum source, and epel source in Linux. For more information about Linux configuration source, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Summary of common Linux distribution mirror source configuration
  • How to configure SVN under Linux to achieve automatic update of project directory and source code installation
  • Detailed explanation of how to configure yum source under Linux
  • Sharing the steps of compiling, installing and configuring SVN server under Linux
  • Linux steps to configure local yum source, configure domestic yum source, and configure epel source
  • A detailed introduction to the three installation methods of rpm, yum and source code under Linux
  • Summary of common Linux commands: yum and source code installation
  • How to install MySQL under Linux (yum and source code compilation)
  • Alibaba Cloud Server Linux System Update Yum Source Shell Script

<<:  Briefly talk about mysql left join inner join

>>:  A brief discussion on VUE uni-app conditional coding and page layout

Recommend

How to use Navicat to export and import mysql database

MySql is a data source we use frequently. It is v...

About the use of Vue v-on directive

Table of contents 1. Listening for events 2. Pass...

Detailed explanation of soft links and hard links in Linux

Table of contents 1. Basic storage of files and d...

Three Discussions on Iframe Adaptive Height Code

When building a B/S system interface, you often en...

Installation tutorial of mysql 5.7 under CentOS 7

1. Download and install the official MySQL Yum Re...

CSS to achieve particle dynamic button effect

Original link https://github.com/XboxYan/no… A bu...

JavaScript realizes magnifying glass special effects

The effect to be achieved: When the mouse is plac...

MySQL 5.7.25 installation and configuration method graphic tutorial

There are two types of MySQL installation files, ...

Rounding operation of datetime field in MySQL

Table of contents Preface 1. Background 2. Simula...

js drag and drop table to realize content calculation

This article example shares the specific code of ...

Detailed explanation of writing multiple conditions of CSS: not

The :not pseudo-class selector can filter element...

Baidu Input Method opens API, claims it can be ported and used at will

The relevant person in charge of Baidu Input Metho...

HTML+CSS to achieve text folding special effects example

This article mainly introduces the example of rea...

Implementation of VUE infinite level tree data structure display

Table of contents Component recursive call Using ...