第三方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源的包請大家一起討論,希望一起學習,也求大神指教!