How to fix "dpkg: error processing package systemd (--configure):

8,267

Check if you are the owner of all directories:

stat / /dev /var

If you aren't the owner, run the following in terminal:

chown root DirectoryYouAreNotOwner

Note: replace DirectoryYouAreNotOwner with the directory that you aren't owner of. So for example if the owner of / was unknown:

chown root /

Credit to this Ask Ubuntu post.

Share:
8,267
Ilak
Author by

Ilak

Updated on September 18, 2022

Comments

  • Ilak
    Ilak over 1 year

    I recently upgraded from 16.04 to 18.04, and I think something went wrong with the upgrade. When I run sudo apt-get install -f, it tries to upgrade udev, but then I get repeated messages about "unsafe symlinks" and this error message:

    dpkg: error processing package systemd (--configure):
     installed systemd package post-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
     systemd
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    I was getting a similar message about systemd-shim earlier, but managed to fix it. I also had a problem with incorrect /etc/apt/sources.list, but I think that's fixed as well. I was getting various error messages during the upgrade process, and at the end I had to "destroy" something instead of finishing the upgrade properly (unfortunately I don't remember exactly what happened.) Any ideas as to what's going on?

    • ldias
      ldias almost 4 years
    • Ilak
      Ilak almost 4 years
      Yes, I believe so! Thanks!
    • ldias
      ldias almost 4 years
      I wrote up an answer based on the post linked above. Please mark it as correct if it helped you.
  • Shahad Mahmud
    Shahad Mahmud about 3 years
    I also have the same problem. But this method does not solve my problem.
  • ldias
    ldias about 3 years
    @ShahadMahmud Are there any error messages? Can you give me more details? What version of Ubuntu, computer hardware, amount of RAM, etc?
  • bortunac
    bortunac over 2 years
    thank you !!!!!!! I've upgraded debian 10->11 as sudo my_name and indeed the / directory was owned by me not the root. ---