Come risolvere "dpkg: errore nell'elaborazione /var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb"?


47

Update Manager non eseguirà l'aggiornamento anche se ho più di 100 aggiornamenti da installare. Ricevo un messaggio di errore come questo:

installArchives() failed: 
Extracting templates from packages: 29%%
Extracting templates from packages: 58%%
Extracting templates from packages: 88%%
Extracting templates from packages: 100%%
Preconfiguring packages ...

Extracting templates from packages: 29%%
Extracting templates from packages: 58%%
Extracting templates from packages: 88%%
Extracting templates from packages: 100%%
Preconfiguring packages ...

Extracting templates from packages: 29%%
Extracting templates from packages: 58%%
Extracting templates from packages: 88%%
Extracting templates from packages: 100%%
Preconfiguring packages ...

Extracting templates from packages: 29%%
Extracting templates from packages: 58%%
Extracting templates from packages: 88%%
Extracting templates from packages: 100%%
Preconfiguring packages ...
(Reading database ... 
(Reading database ... 5%%
(Reading database ... 10%%
(Reading database ... 15%%
(Reading database ... 20%%
(Reading database ... 25%%
(Reading database ... 30%%
(Reading database ... 35%%
(Reading database ... 40%%
(Reading database ... 45%%
(Reading database ... 50%%
(Reading database ... 55%%
(Reading database ... 60%%
(Reading database ... 65%%
(Reading database ... 70%%
(Reading database ... 75%%
(Reading database ... 80%%
(Reading database ... 85%%
(Reading database ... 90%%
(Reading database ... 95%%
(Reading database ... 100%%
(Reading database ... 189751 files and directories currently installed.)
Preparing to replace python-problem-report 2.0.1-0ubuntu7 (using .../python-problem-report_2.0.1-0ubuntu9_all.deb) ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error processing /var/cache/apt/archives/python-problem-report_2.0.1-0ubuntu9_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 39, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Preparing to replace python-apport 2.0.1-0ubuntu7 (using .../python-apport_2.0.1-0ubuntu9_all.deb) ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error processing /var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 39, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Preparing to replace apport 2.0.1-0ubuntu7 (using .../apport_2.0.1-0ubuntu9_all.deb) ...
apport stop/waiting
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error processing /var/cache/apt/archives/apport_2.0.1-0ubuntu9_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
No apport report written because MaxReports is reached already
apport start/running
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 39, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Preparing to replace gnome-orca 3.4.1-0ubuntu0.1 (using .../gnome-orca_3.4.2-0ubuntu0.1_all.deb) ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error processing /var/cache/apt/archives/gnome-orca_3.4.2-0ubuntu0.1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 39, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Preparing to replace python-piston-mini-client 0.7.2-0ubuntu1 (using .../python-piston-mini-client_0.7.2+bzr57-0ubuntu1_all.deb) ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error processing /var/cache/apt/archives/python-piston-mini-client_0.7.2+bzr57-0ubuntu1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 39, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Preparing to replace oneconf 0.2.8 (using .../oneconf_0.2.8.1_all.deb) ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error processing /var/cache/apt/archives/oneconf_0.2.8.1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 39, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Preparing to replace software-center 5.2.2 (using .../software-center_5.2.2.2_all.deb) ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
Traceback (most recent call last):
  File "/usr/bin/pyclean", line 33, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error processing /var/cache/apt/archives/software-center_5.2.2.2_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 39, in <module>
    from debpython.namespace import add_namespace_files
ValueError: bad marshal data (unknown type code)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Preparing to replace libglade2-0 1:2.6.4-1ubuntu1 (using .../libglade2-0_1%%3a2.6.4-1ubuntu1.1_amd64.deb) ...
Unpacking replacement libglade2-0 ...
Preparing to replace libv4l-0 0.8.6-1ubuntu1 (using .../libv4l-0_0.8.6-1ubuntu2_amd64.deb) ...
De-configuring libv4l-0:i386 ...
Unpacking replacement libv4l-0 ...
Preparing to replace libv4l-0:i386 0.8.6-1ubuntu1 (using .../libv4l-0_0.8.6-1ubuntu2_i386.deb) ...
Unpacking replacement libv4l-0:i386 ...
Preparing to replace libv4lconvert0:i386 0.8.6-1ubuntu1 (using .../libv4lconvert0_0.8.6-1ubuntu2_i386.deb) ...
De-configuring libv4lconvert0 ...
Unpacking replacement libv4lconvert0:i386 ...
Preparing to replace libv4lconvert0 0.8.6-1ubuntu1 (using .../libv4lconvert0_0.8.6-1ubuntu2_amd64.deb) ...
Unpacking replacement libv4lconvert0 ...
Errors were encountered while processing:
 /var/cache/apt/archives/python-problem-report_2.0.1-0ubuntu9_all.deb
 /var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb
 /var/cache/apt/archives/apport_2.0.1-0ubuntu9_all.deb
 /var/cache/apt/archives/gnome-orca_3.4.2-0ubuntu0.1_all.deb
 /var/cache/apt/archives/python-piston-mini-client_0.7.2+bzr57-0ubuntu1_all.deb
 /var/cache/apt/archives/oneconf_0.2.8.1_all.deb
 /var/cache/apt/archives/software-center_5.2.2.2_all.deb
Error in function: 
SystemError: E:Sub-process /usr/bin/dpkg returned an error code (1)
Setting up libglade2-0 (1:2.6.4-1ubuntu1.1) ...
dpkg: error processing gnome-orca (--configure):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting configuration.
dpkg: error processing python-problem-report (--configure):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting configuration.
Setting up libv4lconvert0 (0.8.6-1ubuntu2) ...
Setting up libv4lconvert0:i386 (0.8.6-1ubuntu2) ...
dpkg: error processing python-piston-mini-client (--configure):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting configuration.
Setting up libv4l-0 (0.8.6-1ubuntu2) ...
Setting up libv4l-0:i386 (0.8.6-1ubuntu2) ...
dpkg: dependency problems prevent configuration of python-apport:
 python-apport depends on python-problem-report (>= 0.94); however:
  Package python-problem-report is not configured yet.
dpkg: error processing python-apport (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of software-center:
 software-center depends on python-piston-mini-client (>= 0.1+bzr29); however:
  Package python-piston-mini-client is not configured yet.
dpkg: error processing software-center (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of oneconf:
 oneconf depends on python-piston-mini-client (>= 0.3+bzr32-0ubuntu1); however:
  Package python-piston-mini-client is not configured yet.
dpkg: error processing oneconf (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of apport:
 apport depends on python-apport (>= 2.0.1-0ubuntu7); however:
  Package python-apport is not configured yet.
dpkg: error processing apport (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

Questo è andato avanti per due settimane e non riesco a ottenere alcun aggiornamento. Qualsiasi aiuto sarebbe grande.


1
Aggiungi 4 spazi prima di ogni riga di "output". Conferma quale versione di Ubuntu .
— david6

1
@ david6 Sembra che stia usando 12.04. A meno che non stia usando i pacchetti Precise in Oneiric o in un'altra versione di rilascio. (cue: la versione di gnome-orca è 3.4 tra le altre)
— jokerdino

Ho provato a modificare il titolo per essere più specifico e mi sono preso la libertà di aggiungere un tag 12.04. Se qualcuno di voi non è d'accordo, sentitevi liberi di modificare di conseguenza.
— jokerdino

1
La versione di python-problem-report fa parte di un preciso aggiornamento SRU del 4 giugno.
— John S Gruber,

Risposte:


61

È necessario forzare la sovrascrittura dei file che causano gli errori:

sudo dpkg -i --force-overwrite <filename>

Nel tuo caso sarà:

sudo dpkg -i --force-overwrite /var/cache/apt/archives/python-problem-report_2.0.1-0ubuntu9_all.deb

Quindi eseguire:

sudo apt-get -f install

Fonte: http://www.absolutelytech.com/2010/06/30/solved-error-dpkg-error-processing-filename-unpack-trying-to-overwrite/


1
Stavo avendo problemi simili con ottenere un errore di problema prioritario ed eseguire sudo dpkg -i --force-overwrite <nomefile> risolto. Grazie!
— Mike Grace,

1
+1 ho affrontato questo problema del vino nel mio sistema operativo ubuntu16.04 da molto tempo. ora è risolto. grazie per la tua preziosa risposta.
— Satish Sharma

1
+1 Questo impedisce a lxqt daily ppa di lamentarsi dei miei abusi.
— Dominic Cerisano,

38

Puoi provare il seguente comando:

sudo apt-get clean
sudo apt-get update && sudo apt-get upgrade

Se continui a riscontrare lo stesso errore, prova:

sudo dpkg --configure -a
sudo apt-get -f install

Anche se non funziona e ricevi ancora lo stesso errore, ricontrolla e possiamo risolverlo.


Ho avuto un problema simile con E: Problema nel rinominare il file /var/cache/apt/pkgcache.bin.random chars. Ho provato il primo approccio e ha funzionato a livello familiare.
— Elder Geek,

1
Questo non ha avuto alcun effetto per me. Ricevo ancora un sacco di errori come "dpkg: problemi di dipendenza impediscono la configurazione di *"
— Cerin

1
Cosa significa sudo dpkg --configure -aquesto?
— Parag Jadhav,

5

Potrebbe trattarsi di un bug nel pacchetto python-problem-report o nel pacchetto python-minimal o in una copia errata del pacchetto.

Vedo che questo è un pacchetto proposto con precisione. Potresti voler eliminare questo repository dall'elenco delle fonti del software ed eseguire apt-get updateda una sessione terminale ( Ctrl- Alt- T) per ripristinare.

Puoi anche provare a cancellare python-problem-report_2.0.1-0ubuntu9_all.debda /var/cache/apt/archivesquindi apt-get upgradedovrai scaricare di nuovo una nuova copia. Nel terminale ( Ctrl- Alt- T) digitare:

sudo rm /var/cache/apt/archives/python-problem-report_2.0.1-0ubuntu9_all.deb

In alternativa puoi usare:

sudo apt-get clean

per cancellare tutti i file scaricati nella cache.

Prova di nuovo l'aggiornamento.

Se nessuno di questi aiuti è necessario lasciare un commento su https://bugs.launchpad.net/ubuntu/+source/apport/+bug/984944 descrivendo la tua esperienza nell'uso di questo pacchetto proposto, o una volta che il pacchetto è generalmente rilasciato, file un bug sul pacchetto apport.

Ho lasciato un commento su questa domanda su https://bugs.launchpad.net/ubuntu/+source/apport/+bug/984944 ma dovresti aggiungere un commento che descriva i passaggi che hai seguito e l'output di apt- ottenere l'aggiornamento dall'alto.


2
Mentre hai ragione sul denaro che probabilmente è un bug python-problem-report, non mi sento a mio agio a raccomandare il sudo rmcomando. Dovrebbe essere sicuramente l'ultima risorsa. Ottimo lavoro altrimenti!
— jokerdino

Fintanto che il sudo rm ...comando non viene digitato in modo errato, dovrebbe andare bene e non deve essere considerato come ultima risorsa: i file in /var/cache/apt/archivessono solo file di pacchetto archiviati (cioè rimasti). Come dice John S Gruber, il sudo apt-get cleancomando un po 'comunemente raccomandato cancella tutti quei file. L'eliminazione di un file .deb memorizzato nella cache è un modo sicuro ed efficace per garantire che un nuovo .deb (e si spera non corrotto) debba essere scaricato la prossima volta che il pacchetto viene installato (o reinstallato).
— Eliah Kagan,

Non ha funzionato per me
— Hack-R

5
sudo update-alternatives --config python

Ci sono 2 scelte per il python alternativo (fornendo / usr / bin / python).

  Selection    Path                Priority   Status
------------------------------------------------------------
  0            /usr/bin/python3.5   2         auto mode
* 1            /usr/bin/python2.7   1         manual mode
  2            /usr/bin/python3.5   2         manual mode

Press <enter> to keep the current choice[*], or type selection number: 

Seleziona l'opzione python2.7.


2

In alternativa, potresti provare a rimuovere il pacchetto e aggiungerlo in seguito. Questo ha funzionato per me sul client Citrix. Fai attenzione a ciò che stai rimuovendo (ovviamente).

sudo apt-get remove icaclient:i386

1

Ho riscontrato un problema simile su un sistema su cui erano installati sia Python 2.7 che Python 3.4. Il problema era un problema di compatibilità con il pacchetto python-subversion , che apparentemente funziona solo con python 2 a causa di una modifica in ConfigParser . L'ho affrontato facendo

ls -la /usr/bin | grep python

Per confermare che l' eseguibile python sul mio percorso era un collegamento simbolico a python 3. Quindi

ln -s /usr/bin/python2.7 /usr/bin/python

Per usare invece python 2. Dopo che apt-get è stato in grado di completarsi normalmente e ho ripristinato la mia modifica del collegamento simbolico.

rm -f /usr/bin/python
ln -s /usr/bin/python3.4 /usr/bin/python

Gli ultimi 2 comandi possono essere sostituiti da ln -rs /usr/bin/python3.4 /usr/bin/python. Inoltre, se hai già un altro link simbolico che /usr/bin/python3punta all'ultima python3versione, come di solito accade, puoi fare un altro passo avanti ln -rs /usr/bin/python3 /usr/bin/python. Comunque, grazie per la soluzione, ha funzionato per me dopo un problema mercurialnell'installazione.
— tigerjack89,

-1

Prova questo:

mount -t proc proc /proc

Ha funzionato per me.


Puoi aggiungere una spiegazione sul perché questa è una soluzione?
— Igor V.
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.