#查看Centos yum源版本
#安装Centos epel yum源
#查看Centos yum源 enable的模块
备注:使用Centos版本如下:
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
#查看Centos yum源版本
[root@localhost ~]# yum --version
3.4.3
Installed: rpm-4.11.3-32.el7.x86_64 at 2019-11-16 09:45
Built : CentOS BuildSystem http://bugs.centos.org at 2018-04-11 03:54
Committed: Panu Matilainen pmatilai@redhat.com at 2017-11-13
Installed: yum-3.4.3-158.el7.centos.noarch at 2019-11-16 09:46
Built : CentOS BuildSystem http://bugs.centos.org at 2018-04-13 12:58
Committed: CentOS Sources bugs@centos.org at 2018-04-10
Installed: yum-plugin-fastestmirror-1.1.31-45.el7.noarch at 2019-11-16 09:46
Built : CentOS BuildSystem http://bugs.centos.org at 2018-04-11 04:16
Committed: Valentina Mukhamedzhanova vmukhame@redhat.com at 2017-11-21
#安装Centos epel yum源
[root@localhost ~]# yum list |grep epel-release
//查看epel版本
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
epel-release.noarch 7-11 extras
[root@localhost ~]# ls /etc/yum.repos.d/
//查看是否有安装epel模块,如果不存在epel文件,则表示没有安装epel
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@localhost ~]# yum install epel-release -y
//安装epel模块
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
…
Resolving Dependencies
–> Running transaction check
—> Package epel-release.noarch 0:7-11 will be installed
–> Finished Dependency Resolution
…
Installing:
epel-release noarch 7-11 extras 15 k
…
Installed:
epel-release.noarch 0:7-11
Complete!
#查看Centos yum源 enable的模块
[root@localhost ~]# yum repolist enable
//查看哪些yum模块开启
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 8.8 kB 00:00:00
- base: ftp.sjtu.edu.cn
- epel: hkg.mirror.rackspace.com
- extras: mirrors.aliyun.com
- updates: mirror.hkt.cc