1

While updating the Ubuntu 20.04, I am getting the following error:

Errors were encountered while processing:
 /var/cache/apt/archives/libsystemd0_245.4-4ubuntu3.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

The system was running 19.10, and was recently upgraded to 20.04.

The result of sudo apt autoremove is:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libsystemd0 : Breaks: libsystemd0:i386 (!= 245.4-4ubuntu3.1) but 245.4-4ubuntu3.2 is installed
 libsystemd0:i386 : Breaks: libsystemd0 (!= 245.4-4ubuntu3.2) but 245.4-4ubuntu3.1 is installed
 libudev1 : Breaks: libudev1:i386 (!= 245.4-4ubuntu3.1) but 245.4-4ubuntu3.2 is installed
 libudev1:i386 : Breaks: libudev1 (!= 245.4-4ubuntu3.2) but 245.4-4ubuntu3.1 is installed
 systemd : Depends: libsystemd0 (= 245.4-4ubuntu3.2) but 245.4-4ubuntu3.1 is installed
 udev : Depends: libudev1 (= 245.4-4ubuntu3.2) but 245.4-4ubuntu3.1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

The result of sudo apt install libsystemd0 is:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libudev1 : Breaks: libudev1:i386 (!= 245.4-4ubuntu3.1) but 245.4-4ubuntu3.2 is to be installed
 libudev1:i386 : Breaks: libudev1 (!= 245.4-4ubuntu3.2) but 245.4-4ubuntu3.1 is to be installed
 udev : Depends: libudev1 (= 245.4-4ubuntu3.2) but 245.4-4ubuntu3.1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
karel
  • 114,770
V S Punn
  • 127

1 Answers1

2

If you have added any PPAs to your software sources.list that are causing so many version conflicts remove them and restore Ubuntu's default software repositories with How do I restore the default repositories?. Then update the software sources with sudo apt update.

Remove the cached libsystemd0 .deb file that is generating the error message and reinstall libsystemd0 and libudev1.

sudo rm /var/cache/apt/archives/libsystemd0_245.4-4ubuntu3.2_amd64.deb # If this command results in a warning ignore the warning.
sudo apt update # try to update again
sudo apt autoremove 
sudo apt remove libsystemd0:i386 libudev1:i386 libsystemd0 libudev1
sudo apt --fix-broken install 
sudo apt install libsystemd0 libudev1
karel
  • 114,770