1. Configure local yum source1. Mount the ISO imagemount -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 source1. 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:
|
<<: Briefly talk about mysql left join inner join
>>: A brief discussion on VUE uni-app conditional coding and page layout
Sometimes, we need to copy a whole column of data...
This article example shares the specific code of ...
Introduction Binlog logs, that is, binary log fil...
Table of contents What is an event A Simple Examp...
1. Tools We need two tools now: MySQL server (mys...
Method 1: Use the SET PASSWORD command MySQL -u r...
This article example shares the simple implementa...
1. CSS writing format 1. Inline styles You can wr...
Vue front and back end ports are inconsistent In ...
This article shares with you how to connect pytho...
summary During the interview, when discussing abo...
Fabric.js is a very useful canvas operation plug-...
This article describes how to compile and install...
Table of contents 1. Vue initialization vue entry...
Preface This article mainly introduces the releva...