当前位置: 代码迷 >> 综合 >> 使用yum报错:You could try using --skip-broken to work around the problem
  详细解决方案

使用yum报错:You could try using --skip-broken to work around the problem

热度:6   发布时间:2023-12-23 15:01:38.0

今天在centos7中使用 yum -y install couchdb命令安装couchdb时(安装参考《CentOS7安装CouchDB》),出现如下异常:

--> Running transaction check
---> Package python-backports.x86_64 0:1.0-8.el7 will be installed
---> Package python-progressbar.noarch 0:2.3-2.el6 will be installed
--> Processing Dependency: python(abi) = 2.6 for package: python-progressbar-2.3-2.el6.noarch
--> Finished Dependency Resolution
Error: Package: python-progressbar-2.3-2.el6.noarch (epel)Requires: python(abi) = 2.6Installed: python-2.7.5-68.el7.x86_64 (@base)python(abi) = 2.7python(abi) = 2.7Available: python-2.7.5-76.el7.x86_64 (base)python(abi) = 2.7python(abi) = 2.7Available: python34-3.4.8-1.el6.i686 (epel)python(abi) = 3.4You could try using --skip-broken to work around the problemYou could try running: rpm -Va --nofiles --nodigest

因为在安装couchdb之前先执行了:

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmrpm -ivh epel-release-6-8.noarch.rpm

以上命令安装epel-release,因此根据网上资料,开始以为是因为epel-release问题,所以分别使用下面三条命令

yum update -y epel-releaseyum remove epel-releaseyum -y install epel-release

后重试,还出现同样的错误。后来发现另一个解决办法(参考:使用yum 安装插件报错),如下:

yum clean allrpm --rebuilddbyum -y update

命令作用:
【yum clean all】yum 会把下载的软件包和header存储在cache中,而不自动删除。如果觉得占用磁盘空间,可以使用yum clean指令进行清除,更精确 的用法是yum clean headers清除header,yum clean packages清除下载的rpm包,yum clean all一全部清除。(参考:yum clean all的作用)

【rpm --rebuilddb】rpm 有自己的数据库,出现此错误是因为数据库异常导致的,使用rpm --rebuilddb重构一下数据库即可,重构只会重新建立了rpm库表,不安装和删除任何的包

【yum -y update】升级所有包同时也升级软件和系统内核(参考:用实验来证实CentOS7中yum之update与upgrade之间的异同)

 

执行完成后再使用yum -y install couchdb命令成功安装couchdb。


END

  相关解决方案