libselinux conflicts with systemd-219-19.el7.x86_64 and remedies for deleting libselinux

libselinux is a very important dependency package in the Linux system. Many software rely on this package, such as OpenSSL, OpenSSL devel, systemd and so on. If this package is missing, it will cause disastrous consequences. For example, the basic commands such as ls, cp and mv cannot be used, and the yum command cannot be used normally. However, the cd command is not affected by this.

libselinux conflicts with systemd-219-19.el7.x86_64 refers to the conflict between libselinux and SYSTEMd packages, but the error prompt is very general, This error is usually caused by the low or high version of the rpm package used by the yum source (for example, the server version is CentOS 7.9, while the yum source uses the libselinux file in the CentOS 7.2 operating system image file, which will cause obvious mismatch and software conflict).

Since this package is the basic package of Linux system, it is recommended to use the operating system image file used when installing this server. For example, CentOS 7.0 is installed on a server 2.1511 operating system, first ensure that the yum source is from centos7.0 2.1511 files exported from operating system image files.

Secondly, you need to use xshell to log in to the server. The server has installed ZModem protocol software, that is lrzsz this software. When most commands of the system cannot be used, you can directly drag files from the healthy server to the server with problems. The installation command of the software is: yum install lrzsz -y

The dependencies of libselinux are as follows:

[root@master lib64]# rpm -e libselinux
error: Failed dependencies:
	libselinux >= 1.25.2-1 is needed by (installed) shadow-utils-2:
	libselinux >= 1.33.2 is needed by (installed) pam-1.1.8-18.el7.x86_64
	libselinux >= 1.27.7 is needed by (installed) openssh-7.4p1-11.el7.x86_64
	libselinux >= 2.0.64 is needed by (installed) cronie-1.4.11-17.el7.x86_64
	libselinux >= 2.1.6-3 is needed by (installed) passwd-0.79-4.el7.x86_64
	libselinux(x86-64) = 2.5-11.el7 is needed by (installed) libselinux-utils-2.5-11.el7.x86_64
	libselinux(x86-64) = 2.5-11.el7 is needed by (installed) libselinux-python-2.5-11.el7.x86_64
	libselinux(x86-64) >= 1.15.2 is needed by (installed) dbus-1:1.6.12-17.el7.x86_64
	libselinux(x86-64) = 2.5-11.el7 is needed by (installed) libselinux-devel-2.5-11.el7.x86_64 is needed by (installed) glibc-common-2.17-196.el7.x86_64 is needed by (installed) sed-4.2.2-5.el7.x86_64 is needed by (installed) chkconfig-1.7.4-1.el7.x86_64 is needed by (installed) findutils-1:4.5.11-5.el7.x86_64 is needed by (installed) tar-2:1.26-32.el7.x86_64 is needed by (installed) iproute-3.10.0-87.el7.x86_64 is needed by (installed) vim-minimal-2:7.4.160-2.el7.x86_64 is needed by (installed) libselinux-utils-2.5-11.el7.x86_64 is needed by (installed) libsemanage-2.5-8.el7.x86_64 is needed by (installed) coreutils-8.22-18.el7.x86_64 is needed by (installed) krb5-libs-1.15.1-8.el7.x86_64 is needed by (installed) shadow-utils-2: is needed by (installed) libmount-2.23.2-43.el7.x86_64 is needed by (installed) glib2-2.50.3-3.el7.x86_64 is needed by (installed) pam-1.1.8-18.el7.x86_64 is needed by (installed) systemd-libs-219-42.el7.x86_64 is needed by (installed) libselinux-python-2.5-11.el7.x86_64 is needed by (installed) logrotate-3.8.6-14.el7.x86_64 is needed by (installed) rpm-libs-4.11.3-25.el7.x86_64 is needed by (installed) rpm-4.11.3-25.el7.x86_64 is needed by (installed) libuser-0.60-7.el7_1.x86_64 is needed by (installed) util-linux-2.23.2-43.el7.x86_64 is needed by (installed) policycoreutils-2.5-17.1.el7.x86_64 is needed by (installed) rpm-build-libs-4.11.3-25.el7.x86_64 is needed by (installed) rpm-python-4.11.3-25.el7.x86_64 is needed by (installed) device-mapper-libs-7:1.02.140-8.el7.x86_64 is needed by (installed) systemd-219-42.el7.x86_64 is needed by (installed) dbus-1:1.6.12-17.el7.x86_64 is needed by (installed) NetworkManager-1:1.8.0-9.el7.x86_64 is needed by (installed) cronie-anacron-1.4.11-17.el7.x86_64 is needed by (installed) cronie-1.4.11-17.el7.x86_64 is needed by (installed) net-tools-2.0-0.22.20131004git.el7.x86_64 is needed by (installed) openssh-server-7.4p1-11.el7.x86_64 is needed by (installed) parted-3.1-28.el7.x86_64 is needed by (installed) openssh-clients-7.4p1-11.el7.x86_64 is needed by (installed) passwd-0.79-4.el7.x86_64 is needed by (installed) sudo-1.8.19p2-10.el7.x86_64 is needed by (installed) httpd-tools-2.4.6-67.el7.centos.x86_64 is needed by (installed) httpd-2.4.6-67.el7.centos.x86_64 is needed by (installed) libselinux-devel-2.5-11.el7.x86_64 is needed by (installed) krb5-devel-1.15.1-8.el7.x86_64 is needed by (installed) vim-enhanced-2:7.4.160-2.el7.x86_64

Then, if you encounter libselinux conflicts with systemd-219-19 el7. x86_ 64 or similar problems. Just uninstall the rpm package first.

[root@master lib64]# rpm -e libselinux --nodeps

After this uninstallation, most commands such as rpm, yum, ls, mv and cp cannot be used, but the cd command can be used. For example:

[root@master lib64]# ls
ls: error while loading shared libraries: cannot open shared object file: No such file or directory
[root@master lib64]# mv
mv: error while loading shared libraries: cannot open shared object file: No such file or directory
[root@master lib64]# cd /usr/lib64/

At this point, install from a normal machine so. 1 this file can be directly dragged to the directory of / usr/lib64 to be reused.

[root@master lib64]# rpm -qa |grep libselinux

If libselinux devel is not installed, then using yum to install libselinux devel will install libselinux at the same time. If the version of libselinux is low, yum will automatically help you adjust the version of libselinux. In a normal system, the relevant packages of libselinux should be as follows (four, not less):

[root@slave1 ~]# rpm -qa |grep libselinux


If there is a problem with libselinux, you can install libselinux devel on the curve. These two are twins.

The yum source must be selected well. Do not use different operating system image files to make offline installation packages, otherwise the error reports of various dependencies will make you doubt your life.

Lrzsz software is quite useful. In such a case, if there is no lrzsz, it will be more troublesome. You have to enter the rescue mode at least once.

Keywords: Linux Operation & Maintenance server

Added by yuws on Tue, 08 Mar 2022 16:26:23 +0200