The version is 2309. The system was still working normally yesterday, but today it froze directly at the boot screen when starting up. I tried entering single-user mode, and it gave the following error:
/sbin/init: Error while loading shared libraries: libsystemd-core-253.so: Cannot open shared object
Does anyone have any insights into what might be causing this?
This is a serious system boot failure. The /sbin/init (which is systemd itself) fails to load the core shared library libsystemd-core-253.so during startup, preventing the system from booting normally. Below is an analysis of the possible causes and steps to fix it.
Root Cause Analysis
libsystemd-core-253.so is the core dynamic library of systemd (version 253), and /sbin/init is a symbolic link to systemd. This error typically occurs due to one of the following reasons:
Library file deleted or corrupted: The file /usr/lib64/libsystemd-core-253.so is missing or damaged.
Incomplete systemd package upgrade/downgrade: Some files were updated, but dependencies were not synchronized, leading to version mismatches.
Corrupted /etc/ld.so.cache: The dynamic linker cache does not include the correct path to the library.
Filesystem corruption: I/O errors on the root partition prevent the file from being read.
Repair Steps
Since the system cannot boot normally, you must use Rescue Mode or a Live CD/USB to access and repair the system.
Step 1: Enter Rescue Environment
Boot from the openEuler installation ISO and select “Troubleshooting” → “Rescue a openEuler system”.
Alternatively, use a Live image and manually mount the original root partition:
bash
Edit
1 mkdir /mnt/sysroot
2 mount /dev/sdaX /mnt/sysroot # Mount root partition
3 mount --bind /dev /mnt/sysroot/dev
4 mount --bind /proc /mnt/sysroot/proc
5 mount --bind /sys /mnt/sysroot/sys
6 chroot /mnt/sysroot
Step 2: Check if the Library File Exists
bash
Edit
1 # Search for the library file
2 find /usr/lib64 -name "libsystemd-core*.so*" 2>/dev/null
3 ls -l /usr/lib64/libsystemd-core-253.so
If the file exists: It’s likely a cache issue — run ldconfig to rebuild the cache.
If the file is missing: You need to reinstall the systemd package.
Step 3: Reinstall systemd
bash
Edit
1 # Check systemd package status
2 rpm -qa | grep systemd
3 # Reinstall systemd (automatically restores missing library files)
4 dnf reinstall -y systemd
5 # If dnf is not available, use rpm to force reinstall
6 rpm -ivh --force --replacepkgs systemd-*.rpm
If network access is unavailable, extract systemd-*.rpm from the Packages/ directory of the same-version openEuler ISO for offline installation.
Step 4: Rebuild Dynamic Linker Cache
bash
Edit
1 # Ensure the library path is configured
2 echo "/usr/lib64" > /etc/ld.so.conf.d/usr-lib64.conf
3 # Rebuild the cache
4 ldconfig
5 # Verify the library is now registered
6 ldconfig -p | grep libsystemd-core
Step 5: Verify the Fix
bash
Edit
1 # Check that all dependencies of init are resolved
2 ldd /sbin/init | grep "not found"
3 # Once no missing dependencies are reported, exit chroot and reboot
4 exit
5 reboot
Prevention Tips
Never manually delete files in /usr/lib64/ — always use package managers.
Ensure upgrade integrity: Use dnf upgrade --refresh instead of manually replacing RPM packages.
Regularly back up critical system files, especially those in /usr/lib64/ and /etc/ld.so.conf.d/.
Enable official openEuler repositories to ensure proper dependency resolution.
If the above steps fail, the root filesystem may be damaged. Run a disk health check (smartctl -a /dev/sda) and consider restoring from a known good backup.