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

Detailed explanation of Xshell common problems and related configurations

This article introduces common problems of Xshell...

Tutorial on installing mysql5.7.36 database in Linux environment

Download address: https://dev.mysql.com/downloads...

8 powerful techniques for HTML web page creation

<br />Although there are many web page creat...

Vue+video.js implements video playlist

This article shares the specific code of vue+vide...

MySQL SQL statement performance tuning simple example

MySQL SQL statement performance tuning simple exa...

Special commands in MySql database query

First: Installation of MySQL Download the MySQL s...

Detailed explanation of the principle of Vue monitoring data

Table of contents 1. Introduction II. Monitoring ...

Modify file permissions (ownership) under Linux

Linux and Unix are multi-user operating systems, ...

Summary of some problems encountered when integrating echarts with vue.js

Preface I'm currently working on the data ana...

Mysql specifies the date range extraction method

In the process of database operation, it is inevi...

Docker Basics

Preface: Docker is an open source application con...

Detailed explanation of vue keepAlive cache clearing problem case

Keepalive is often used for caching in Vue projec...

About the pitfalls of implementing specified encoding in MySQL

Written in front Environment: MySQL 5.7+, MySQL d...