0

I know, this is very unfortunate and could have been prevented, beeing more careful, but I just accidentally deleted the entire directory /etc/systemd/system/ on my (up to date) Arch Linux machine.

The content of the directory formerly was:

  • dbus-org.freedesktop.Avahi.service -> /usr/lib/systemd/system/avahi-daemon.service getty.target.wants
  • multi-user.target.wants
  • printer.target.wants
  • sleep.target.wants
  • systemd-user-sessions.service.d

I would be very happy, if anyone here could help me with what I should do know soon. I am a little bit concerned right now. Thanks a lot in advance!

Best regards

1

Hi

This is not really a serious problem because this directory only contains symlink to real service file inside /usr/lib/systemd/system

I could not help you to back up your system as before massive deletion but you can be sure your system will be work again

I always to recreate the strict minimum symlink to guarantee your system will works for the next reboot

sudo systemctl enable getty@tty1.service
sudo systemctl enable remote-fs.target

In my opinion only with that your system could reboot without problem. You just will not get your graphic interface because your display manager is not still started at boot. So you can type the same command as above with your display manager service name (sddm, gdm, kdm, lightdm, ...)

After that you should recover a working system but you will need to manually enable each services that you remember you automatically started at boot before, the following command should help you to retrieve a list of daemons to re-enable :

sudo systemctl list-unit-files

I don't know but it is possible that systemd cache or keep in memory your current daemons state unchanged so may be you could simply get with this command all daemons enabled before without to have to remember

Finally, just for security you could reinstall your current packages list to create its files if does not exist, for example with command like :

for pkg in $(pacman -Q | cut -d' ' -f1); do
    sudo pacman -S --noconfirm $pkg
done

I hope it could help you but I don't think your deletion is very problematic for archlinux working

Bye

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.