dpkg-divert: error: rename involves overwriting error after upgrading from 16.04 to 16.10
28,280
Using the terminal, rename
/usr/share/dbus-1/system-services/org.freedesktop.systemd1.service
to/usr/share/dbus-1/system-services/org.freedesktop.systemd1.service.bak
:sudo mv /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service.bak
Proceed to run
sudo apt upgrade
again.
Hopefully no more systemd-shim
errors should appear.
Rename the file back to what it was if you have any issues.
Related videos on Youtube
![zappee](https://i.stack.imgur.com/XoDg6.gif?s=256&g=1)
Comments
-
zappee almost 2 years
I got a strange error after upgrading Ubuntu 16.04 to 16.10.
The Software Updater suggests a partial update:
Could not install 'systemd-shim'
The upgrade will continue but the 'systemd-shim' package may not be in a working state. Please consider submitting a bug report about it.
subprocess installed post-removal script returned error exit status 2
sudo apt-get update
finishes without any error.sudo apt-get remove
outputs thisThe following packages will be REMOVED: systemd-shim 0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade. 1 not fully installed or removed. After this operation, 71.7 kB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 1451244 files and directories currently installed.) Removing systemd-shim (9-1bzr4ubuntu1) ... Removing 'diversion of /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service to /usr/share/dbus-1/system-services/org.freedesktop.systemd1.service.systemd by systemd-shim' dpkg-divert: error: rename involves overwriting '/usr/share/dbus-1/system-services/org.freedesktop.systemd1.service' with different file '/usr/share/dbus-1/system-services/org.freedesktop.systemd1.service.systemd', not allowed dpkg: error processing package systemd-shim (--remove): subprocess installed post-removal script returned error exit status 2 Errors were encountered while processing: systemd-shim E: Sub-process /usr/bin/dpkg returned an error code (1)
Please help me to fix this error. Thank you.
-
Haydentech almost 6 yearsAlso had this problem going from 16.04 to 18.04. Your solution works there too.
-
baptx over 5 years@Haydentech me too, Ubuntu upgrades are such a pain askubuntu.com/questions/1085665/…
-
Silver Moon about 4 yearsfaced this problem when upgrading my server from 16.04 to 18.04. This rename trick worked fine, and the server was able to install all upgrades.
-
Ville Laitila almost 4 yearsI had it when going from 14.04 to 16.04. Solution worked, thanks!