dpkg-divert: errore: la ridenominazione comporta un errore di sovrascrittura dopo l'aggiornamento da 16.04 a 16.10


44

Ho ricevuto uno strano errore dopo aver aggiornato Ubuntu 16.04 a 16.10.

Software Updater suggerisce un aggiornamento parziale:

Impossibile installare "systemd-shim"

L'aggiornamento continuerà ma il pacchetto 'systemd-shim' potrebbe non essere funzionante. Ti preghiamo di considerare di inviare una segnalazione di bug al riguardo.

subprocess installed post-removal script returned error exit status 2

sudo apt-get update termina senza errori.

sudo apt-get remove genera questo

The 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)

Aiutatemi a correggere questo errore. Grazie.

Risposte:


82
  1. Utilizzando il terminale, rinominare /usr/share/dbus-1/system-services/org.freedesktop.systemd1.servicein /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
    
  2. Procedere di sudo apt upgradenuovo con l' esecuzione .

Eventualmente non systemd-shimdovrebbero apparire più errori.

Rinomina il file in quello che era in caso di problemi.


18
Anche questo problema andava dal 16.04 al 18.04. La tua soluzione funziona anche lì.
— Haydentech,

@Haydentech anche a me, gli aggiornamenti di Ubuntu sono così dolorosi askubuntu.com/questions/1085665/…
— baptx
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.