hl10502的博客

Error: libselinux conflicts with systemd-219-19.el7.x86_64

在CentOS7.2上安装Jewel版ceph-10.2.7时,出现错误信息:libselinux-2.5-6.el7.x86_64 conflicts systemd < 219-20。
由于CentOS7.2上的systemd版本为219-19,刚好与libselinux-2.5-6.el7.x86_64冲突。

在CentOS7.2上安装Ceph-10.2.7时具体错误信息

1
2
3
4
5
--> Processing Conflict: libselinux-2.5-6.el7.x86_64 conflicts systemd < 219-20
--> Finished Dependency Resolution
Error: libselinux conflicts with systemd-219-19.el7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

环境

  • CentOS Linux release 7.2.1511 (Core)
  • ceph-10.2.7

解决方法

  • 方法一:修改libselinux-2.5-6.el7.x86_64依赖,重新打包
  • 方法二:升级systemd,将systemd.x86_64 0:219-19.el7更新到systemd.x86_64 0:219-30.el7_3.9
  • 方法三:修改ceph-10.2.7依赖,去掉selinux,重新打包

本文使用方法一来解决此问题。

编译libselinux

rpm编译打包可以参考 ceph-deploy源码制作rpm包

使用root用户打rpm包

1
2
[root@localhost ~]# cd /root/
[root@localhost ~]# vi .rpmmacrosvi

添加以下内容
%_topdir /root/rpmbuild/

创建编译目录

1
2
3
4
5
6
7
8
9
[root@localhost ~]# mkdir rpmbuild
[root@localhost ~]# cd rpmbuild
[root@localhost rpmbuild]# mkdir -pv {BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
mkdir: created directory ‘BUILD’
mkdir: created directory ‘BUILDROOT’
mkdir: created directory ‘RPMS’
mkdir: created directory ‘SOURCES’
mkdir: created directory ‘SPECS’
mkdir: created directory ‘SRPMS’

修改libselinux-2.5-6.el7.src目录下的libselinux.spec文件

1
Conflicts: filesystem < 3 systemd < 219-20

修改成

1
Conflicts: filesystem < 3 systemd < 219-19

将libselinux-2.5-6.el7.src目录下的libselinux.spec复制到/root/rpmbuild/SPECS目录,其他文件复制到/root/rpmbuild/SOURCES目录

1
2
3
4
5
[root@localhost ~]# cp /opt/libselinux.spec /root/rpmbuild/SPECS
[root@localhost ~]# cp /opt/libselinux-2.5.tar.gz /root/rpmbuild/SOURCES
[root@localhost ~]# cp /opt/libselinux-rhel.patch /root/rpmbuild/SOURCES
[root@localhost ~]# cp /opt/selinuxconlist.8 /root/rpmbuild/SOURCES
[root@localhost ~]# cp /opt/selinuxdefcon.8 /root/rpmbuild/SOURCES

编译打包

1
2
[root@localhost ~]# cd /root/rpmbuild/SPECS
[root@localhost SPECS]# rpmbuild -ba libselinux.spec

将/root/rpmbuild/RPMS/x86_64/生成二进制包copy出来
libselinux-2.5-6.el7.centos.x86_64.rpm
libselinux-utils-2.5-6.el7.centos.x86_64.rpm