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

Introduction to the use of MySQL pt-slave-restart tool

Table of contents When setting up a MySQL master-...

Process parsing of reserved word instructions in Dockerfile

Table of contents 1. What is Dockerfile? 2. Analy...

Radio buttons and multiple-choice buttons are styled using images

I've seen people asking before, how to add sty...

Cause Analysis and Solution of I/O Error When Deleting MySQL Table

Problem phenomenon I recently used sysbench to te...

Detailed analysis of binlog_format mode and configuration in MySQL

There are three main ways of MySQL replication: S...

64-bit CentOs7 source code installation mysql-5.6.35 process sharing

First install the dependent packages to avoid pro...

Solution to the problem of adaptive height and width of css display table

Definition and Usage The display property specifi...

HTML table markup tutorial (37): background image attribute BACKGROUND

Set the background image for the table header. Yo...

Solution to the problem of insufficient storage resource pool of Docker server

Table of contents 1. Problem Description 2. Probl...

JavaScript implementation of the back to top button example

This article shares the specific code for JavaScr...

How to configure the pdflatex environment in docker

Technical Background Latex is an indispensable to...

About the use of Vue v-on directive

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

JavaScript anti-shake case study

principle The principle of anti-shake is: you can...

Detailed explanation of the use of various MySQL indexes

1. Slow query log 1.1 MySQL log types Logs are us...

How to show or hide common icons on the desktop in Windows Server 2012

Windows Server 2012 and Windows Server 2008 diffe...