centos环境 epel安装完毕后无法使用的问题解决

最近在弄些一键脚本玩,偶尔发现我有一台服务器的mediainfo无法安装,原因是没有安装三方源epel-release

问题环境是发生在centos6下面,这个很简单立马去安装三方源

wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
显示如下
Preparing...                ########################################### [100%]
	package epel-release-6-8.noarch is already installed

然后安装mediainfo,依然提示不存在mdeiainfo package。

怒了,执行

yum repolist #查看安装的repo
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.kernel.org
 * extras: mirrors.kernel.org
 * geekery: geekery.epac.to
 * rpmfusion-free-updates: mirror.web-ster.com
 * rpmfusion-nonfree-updates: mirror.web-ster.com
 * updates: mirrors.kernel.org
repo id                                                                     repo name                                                                                 status
base                                                                        CentOS-6 - Base                                                                           6706
extras                                                                      CentOS-6 - Extras                                                                           64
geekery                                                                     geekery repository for EL6 - x86_64                                                        131
rpmfusion-free-updates                                                      RPM Fusion for EL 6 - Free - Updates                                                       220
rpmfusion-nonfree-updates                                                   RPM Fusion for EL 6 - Nonfree - Updates                                                     36
updates                                                                     CentOS-6 - Updates                                                                         282

竟然没有epel,怎么回事

[root@local ~]# yum --enablerepo=epel       #强制指定使用epel源也报失败
Loaded plugins: fastestmirror


Error getting repository data for epel, repository not found
[root@local ~]# cd /etc/yum.repos.d/ 
[root@localhost yum.repos.d]# ll
total 48
-rw-r--r-- 1 root root 1991 Mar 28 18:25 CentOS-Base.repo
-rw-r--r-- 1 root root  647 Mar 28 18:25 CentOS-Debuginfo.repo
-rw-r--r-- 1 root root  630 Mar 28 18:25 CentOS-Media.repo
-rw-r--r-- 1 root root 7989 Mar 28 18:25 CentOS-Vault.repo
-rw-r--r-- 1 root root  289 Mar 28 18:25 CentOS-fasttrack.repo
-rw-r--r-- 1 root root 1056 Nov  5  2012 epel-testing.repo
-rw-r--r-- 1 root root  254 Apr 27  2016 geekery.repo
-rw-r--r-- 1 root root 1062 Jun 19  2012 rpmfusion-free-updates-testing.repo
-rw-r--r-- 1 root root 1002 May 15  2011 rpmfusion-free-updates.repo
-rw-r--r-- 1 root root 1107 Jun 19  2012 rpmfusion-nonfree-updates-testing.repo
-rw-r--r-- 1 root root 1047 May 15  2011 rpmfusion-nonfree-updates.repo

麻蛋,repo目录下竟然没有epel.repo,只能先卸载看看

[root@local ~]# rpm -e epel-release-6-8.noarch
error: Failed dependencies:
	epel-release >= 6 is needed by (installed) rpmfusion-free-release-6-1.noarch
	epel-release >= 6 is needed by (installed) rpmfusion-nonfree-release-6-1.noarch

卸载也失败,可能是安装rpmfusion源顺序不对,造成冲突了,查明原因后决定先卸载rpmfusion源

[root@local ~]# rpm -qa |grep rpmfusion
rpmfusion-nonfree-release-6-1.noarch
rpmfusion-free-release-6-1.noarch
[root@local ~]# rpm -e rpmfusion-nonfree-release
[root@local ~]# rpm -e rpmfusion-free-release

然后再次安装epel源

root@local ~]# rpm -ivh epel-release-6-8.noarch.rpm 
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]
[root@local ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/metalink                                                                                                                                        | 9.6 kB     00:00     
 * base: mirrors.kernel.org
 * epel: dl.fedoraproject.org
 * extras: mirrors.kernel.org
 * geekery: geekery.epac.to
 * updates: mirrors.kernel.org
epel                                                                                                                                                 | 4.3 kB     00:00     
epel/primary_db                                                                                                                                      | 5.9 MB     00:00     
repo id                                                        repo name                                                                                              status
base                                                           CentOS-6 - Base                                                                                         6706
epel                                                           Extra Packages for Enterprise Linux 6 - x86_64                                                         12303
extras                                                         CentOS-6 - Extras                                                                                         64
geekery                                                        geekery repository for EL6 - x86_64                                                                      131
updates                                                        CentOS-6 - Updates                                                                                       282
repolist: 19486

成功安装好,试下安装mediainfo

[root@local ~]# yum install mediainfo
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.kernel.org
 * epel: pubmirror1.math.uh.edu
 * extras: mirrors.kernel.org
 * geekery: geekery.epac.to
 * updates: mirrors.kernel.org
Resolving Dependencies
--> Running transaction check
---> Package mediainfo.x86_64 0:0.7.94-1.el6 will be installed
--> Processing Dependency: libzen.so.0()(64bit) for package: mediainfo-0.7.94-1.el6.x86_64
--> Processing Dependency: libmediainfo.so.0()(64bit) for package: mediainfo-0.7.94-1.el6.x86_64
--> Running transaction check
---> Package libmediainfo.x86_64 0:0.7.94-1.el6 will be installed
--> Processing Dependency: libtinyxml2.so.1()(64bit) for package: libmediainfo-0.7.94-1.el6.x86_64
---> Package libzen.x86_64 0:0.4.35-1.el6 will be installed
--> Running transaction check
---> Package tinyxml2.x86_64 0:1.0.11-4.20130805git0323851.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================
 Package                                 Arch                              Version                                                    Repository                       Size
============================================================================================================================================================================
Installing:
 mediainfo                               x86_64                            0.7.94-1.el6                                               epel                             69 k
Installing for dependencies:
 libmediainfo                            x86_64                            0.7.94-1.el6                                               epel                            2.1 M
 libzen                                  x86_64                            0.4.35-1.el6                                               epel                             99 k
 tinyxml2                                x86_64                            1.0.11-4.20130805git0323851.el6                            epel                             31 k

Transaction Summary
============================================================================================================================================================================
Install       4 Package(s)

Total download size: 2.3 M
Installed size: 7.2 M
Is this ok [y/N]: y

......#省略

Verifying  : tinyxml2-1.0.11-4.20130805git0323851.el6.x86_64                                                                                                          4/4 

Installed:
  mediainfo.x86_64 0:0.7.94-1.el6                                                                                                                                           

Dependency Installed:
  libmediainfo.x86_64 0:0.7.94-1.el6                    libzen.x86_64 0:0.4.35-1.el6                    tinyxml2.x86_64 0:1.0.11-4.20130805git0323851.el6                   

Complete!

果然没有问题

再次安装rpmfusion源 #ffmpeg的三方源

后进行检验

[root@local ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.syringanetworks.net
 * epel: dl.fedoraproject.org
 * extras: mirrors.syringanetworks.net
 * geekery: geekery.epac.to
 * rpmfusion-free-updates: mirror.web-ster.com
 * rpmfusion-nonfree-updates: mirror.web-ster.com
 * updates: mirrors.syringanetworks.net
repo id                                                                 repo name                                                                                     status
base                                                                    CentOS-6 - Base                                                                                6706
epel                                                                    Extra Packages for Enterprise Linux 6 - x86_64                                                12303
extras                                                                  CentOS-6 - Extras                                                                                64
geekery                                                                 geekery repository for EL6 - x86_64                                                             131
rpmfusion-free-updates                                                  RPM Fusion for EL 6 - Free - Updates                                                            220
rpmfusion-nonfree-updates                                               RPM Fusion for EL 6 - Nonfree - Updates                                                          36
updates                                                                 CentOS-6 - Updates                                                                              282
repolist: 19742

没问题了,和epel可以共存问题到此解决。

事后分析,可能是当时先安装了非epel的三方源,再安装epel源时起了冲突,导致epel源无法安装,碰到这类问题时先解决冲突后再安装一般可以解决问题。

 

 

 

仅有1条评论 发表评论

  1. 香港服务器 /

    我也遇到过这问题,坐个沙发

发表评论