Recovering a Deepin System from Boot Failure Caused by Removing systemd

Background

systemd acts as the initialization system and service manager for the majority of modern Linux distributions, including Deepin. It is responsible for booting the user space and managing system services. The apt-get autoremove utility is designed to clean up packages that were installed as dependencies but are no longer required. However, incorrectly running apt-get autoremove systemd can uninstall this critical component, rendering the operating system unbootable.

Recovery Procedure

1. Boot into a Live Environment

Create a bootable Deepin installation medium (USB or DVD) using an ISO image and a flashing tool. Insert the media into the affected machine and boot from it, selecting the "Try Deepin" or Live session option.

2. Mount the Root Partition and Configure Chroot

Identify the root partition (e.g., /dev/sda2) and mount it. Then, bind the virtual filesystems required for the repair.

sudo mount /dev/sda2 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount --bind /run /mnt/run
sudo chroot /mnt

3. Reinstall systemd and Fix Dependencies

Once inside the chroot environment, refresh the package lists and reinstall the systemd package. If dependency errors occur, use the fix-broken flag.

apt-get update
apt-get install --reinstall systemd
apt-get -f install

4. Update Initial RAM Filesystem

Regenerate the initramfs to ensure the kernel has the necessary modules to boot.

update-initramfs -u -k all

5. Exit and Reboot

Unmount the filesystems and restart the computer.

exit
sudo umount /mnt/dev/pts
sudo umount /mnt/{dev,proc,sys,run}
sudo umount /mnt
sudo reboot

Troubleshoooting

Issue Solution
Dependency errors during install Run apt-get update and apt-get -f install inside the chroot to resolve conflicts.
Version mismatch with Live CD It is recommended to use a Live image that matches the architecture and version of the installed system to avoid library incompatibilities.

Key Components Overview

Component Description
systemd Core init system handling service management and boot process.
apt-get Command-line tool for handling Debian packages.
chroot Operation to change the apparent root directory for the current running process.
Live USB External bootable media used for system maintenance and recovery.

Tags: Deepin Linux Recovery systemd Boot Repair chroot

Posted on Sat, 20 Jun 2026 17:25:15 +0000 by frao_0