第三方yum源安装后,之后用于安装的是哪个yum源
2024-06-28 16:03:20
供稿:网友
第三方yum源创建后,想不通的一个过程是,原来的yum源还能在使用吗?于是想了个方法测试了一下。
1.我的系统版本:
[root@localhost ~]# cat /etc/redhat-release CentOS release 6.8 (Final)2.查看yum源的当前状态:
[root@localhost ~]# yum list > test #我不知道还有什么方法可以看到yum源路径,只能先用笨方法。[root@localhost ~]# vim testLoaded plugins: fastestmirror, refresh-packagekit, securityInstalled PackagesConsoleKit.x86_64 0.4.1-6.el6 @anaconda-CentOS-201605220104.x86_64/6.8ConsoleKit-libs.x86_64 0.4.1-6.el6 @anaconda-CentOS-201605220104.x86_64/6.83.查看默认yum的配置:
[root@localhost yum.repos.d]# ll total 24-rw-r--r--. 1 root root 1991 May 18 2016 CentOS-Base.repo-rw-r--r--. 1 root root 647 May 18 2016 CentOS-Debuginfo.repo-rw-r--r--. 1 root root 289 May 18 2016 CentOS-fasttrack.repo-rw-r--r--. 1 root root 630 May 18 2016 CentOS-Media.repo-rw-r--r--. 1 root root 6259 May 18 2016 CentOS-Vault.repo
#以下证明CentOS-Base.repo是在使用的yum源,其他就不详细[root@localhost yum.repos.d]# vim CentOS-Base.repo[base]name=CentOS-$releasever - Basemirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6[root@localhost yum.repos.d]# vim CentOS-fasttrack.repo[fasttrack]name=CentOS-6 - fasttrackmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=fasttrack&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/fasttrack/$basearch/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 4.准备安装第三方yum源:
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo5.查看变化:
[root@localhost yum.repos.d]# lltotal 28-rw-r--r--. 1 root root 1991 May 18 2016 CentOS-Base.repo-rw-r--r--. 1 root root 647 May 18 2016 CentOS-Debuginfo.repo-rw-r--r--. 1 root root 289 May 18 2016 CentOS-fasttrack.repo-rw-r--r--. 1 root root 630 May 18 2016 CentOS-Media.repo-rw-r--r--. 1 root root 6259 May 18 2016 CentOS-Vault.repo-rw-r--r--. 1 root root 1083 May 14 2015 epel.repo #多了一个yum源[root@localhost yum.repos.d]# vim CentOS-Base.repo[base]name=CentOS-$releasever - Basemirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6[root@localhost yum.repos.d]# vim epel.repo[epel]name=Extra Packages for EnterPRise linux 6 - $basearchbaseurl=http://mirrors.aliyun.com/epel/6/$basearch http://mirrors.aliyuncs.com/epel/6/$basearch#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearchfailovermethod=priorityenabled=1 #说明这个可以用gpgcheck=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6[root@localhost ~]# yum list > test1[root@localhost ~]# vim test1Loaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * epel: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comzeromq3-devel.i686 3.2.5-1.el6 epelzeromq3-devel.x86_64 3.2.5-1.el6 epelzfs-fuse.x86_64 0.6.9-6.20100709git.el6 epelzikula.noarch 1.2.3-1.el6 epelzile.x86_64 2.4.9-1.el6 epelzipios++.i686 0.1.5.9-8.el6 epelzipios++.x86_64 0.1.5.9-8.el6 epelzipios++-devel.i686 0.1.5.9-8.el6 epelzipios++-devel.x86_64 0.1.5.9-8.el6 epel #明显的是[epel]zlib.i686 1.2.3-29.el6 base #明显的是[base]zlib-devel.i686 1.2.3-29.el6 basezlib-devel.x86_64 1.2.3-29.el6 basezlib-static.x86_64 1.2.3-29.el6 base6.对比一下:使用vim + test/test1 与末行模式下 :set number
第三方yum,有19250行,默认yum,6854行test1中既有base源的包也有epel源的包请大家一起讨论,希望一起学习,也求大神指教!