Comment résoudre “dpkg: error processing /var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb”?


47

Update Manager ne mettra pas à jour même si j'ai plus de 100 mises à jour à installer. Je reçois un message d'erreur comme celui-ci:

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

Cela dure depuis deux semaines maintenant et je ne peux obtenir aucune mise à jour. Toute aide est la bienvenue.


1
Veuillez ajouter 4 espaces avant chaque ligne de 'sortie'. Veuillez confirmer quelle version d' Ubuntu .
— david6

1
@ david6 On dirait qu'il utilise la version 12.04. Sauf s'il utilise des packages Precise dans Oneiric ou une autre version. (cue: la version de gnome-orca est 3.4 parmi d'autres)
— jokerdino

J'ai essayé de modifier le titre pour qu'il soit plus spécifique et j'ai pris la liberté d'ajouter une balise 12.04. Si vous êtes en désaccord, n'hésitez pas à éditer en conséquence.
— jokerdino

1
La version python-problem-report fait partie d’une distribution précise de la SRU apport le 4 juin.
— John S Gruber

Réponses:


61

Vous devez forcer le remplacement des fichiers à l’origine des erreurs:

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

Dans votre cas, ça va être:

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

Puis lancez:

sudo apt-get -f install

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


1
Je rencontrais des problèmes similaires lors de l'obtention d'une erreur de problème prioritaire et de l'exécution de sudo dpkg -i --force-overwrite <nom_fichier>. Merci!
— Mike Grace

1
+1 J'étais confronté à cette question du vin dans mon OS ubuntu16.04 depuis longtemps. c'est résolu maintenant. merci pour votre réponse précieuse.
— Satish Sharma

1
+1 Ceci arrête lxqt journalier ppa de se plaindre de mes abus.
— Dominic Cerisano

38

Vous pouvez essayer la commande suivante:

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

Si vous vous retrouvez toujours avec la même erreur, essayez:

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

Même si cela ne fonctionne pas et que vous obtenez toujours la même erreur, vérifiez à nouveau et nous pouvons résoudre ce problème.


J'ai eu un problème similaire avec E: Problème lors du changement de nom du fichier /var/cache/apt/pkgcache.bin.random. J'ai essayé la première approche et cela a fonctionné en famille.
— Elder Geek

1
Cela n'a eu aucun effet pour moi. Je reçois toujours une tonne d'erreurs du type "dpkg: des problèmes de dépendance empêchent la configuration de *"
— Cerin

1
Qu'est sudo dpkg --configure -ace que cela signifie?
— Parag Jadhav

5

Il peut s'agir d'un bogue dans le package python-problem-report ou python-minimal ou une copie incorrecte du package.

Je vois que c'est un paquet de précis-proposé. Vous souhaiterez peut-être supprimer ce référentiel de votre liste de sources de logiciels et l'exécuter à apt-get updatepartir d'une session de terminal ( Ctrl- Alt- T) pour la récupérer.

Vous pouvez également essayer de supprimer python-problem-report_2.0.1-0ubuntu9_all.debde /var/cache/apt/archivesdonc vous apt-get upgradedevrez télécharger une nouvelle copie à nouveau. Dans le terminal ( Ctrl- Alt- T), tapez:

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

Sinon, vous pouvez utiliser:

sudo apt-get clean

pour effacer tous les fichiers téléchargés dans votre cache.

Essayez à nouveau la mise à niveau.

Si aucune de ces solutions ne vous aide, vous devez laisser un commentaire à l' adresse https://bugs.launchpad.net/ubuntu/+source/apport/+bug/984944, décrivant votre expérience de l'utilisation du package proposé ou une fois que le package est généralement publié, fichier un bogue contre le paquetage.

J'ai laissé un commentaire à propos de cette question à l' adresse https://bugs.launchpad.net/ubuntu/+source/apport/+bug/984944 mais vous devriez ajouter un commentaire décrivant les étapes que vous avez suivies et le résultat de apt- obtenir la mise à niveau d'en haut.


2
Bien que vous ayez raison de dire qu'il s'agit probablement d'un bug python-problem-report, je ne suis pas à l'aise pour recommander cette sudo rmcommande. Cela devrait certainement être le dernier recours. Bon travail sinon!
— jokerdino

Tant que la sudo rm ...commande n'est pas mal typée, elle devrait être correcte et ne doit pas être considérée comme un dernier recours: les fichiers /var/cache/apt/archivesentrants ne sont que des fichiers archivés (c'est-à-dire restants). Comme le dit John S. Gruber, la sudo apt-get cleancommande un peu communément recommandée supprime tous ces fichiers. La suppression d'un fichier .deb en cache est un moyen sûr et efficace de garantir un nouveau fichier (et, espérons-le, non corrompu) .deb doit être téléchargé à la prochaine installation du paquet (ou réinstallé).
— Eliah Kagan

N'a pas travaillé pour moi
— Hack-R

5
sudo update-alternatives --config python

Il existe 2 choix pour l’alternative python (fournissant / 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: 

Sélectionnez l'option python2.7.


2

Au lieu de cela, vous pouvez essayer de supprimer le package et de l'ajouter par la suite. Cela a fonctionné pour moi sur le client Citrix. Faites attention à ce que vous supprimez (bien sûr).

sudo apt-get remove icaclient:i386

1

J'ai rencontré un problème similaire sur un système sur lequel Python 2.7 et 3.4 avaient été installés. Le problème était un problème de compatibilité avec le paquetage python-subversion , qui ne fonctionne apparemment qu'avec python 2 en raison d'une modification de ConfigParser . Je l'ai abordé en faisant

ls -la /usr/bin | grep python

Pour confirmer que l’ exécutable python sur mon chemin était un lien symbolique vers python 3. Ensuite,

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

Pour utiliser python 2 à la place. Après cela, apt-get a pu se terminer normalement et j'ai annulé mon changement de lien symbolique.

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

Les 2 dernières commandes peuvent être remplacées par ln -rs /usr/bin/python3.4 /usr/bin/python. De plus, si vous avez déjà un autre lien symbolique /usr/bin/python3pointant vers la dernière python3version, comme cela se produit généralement, vous pouvez faire un autre pas en avant avec ln -rs /usr/bin/python3 /usr/bin/python. Quoi qu'il en soit, merci pour la solution, cela a fonctionné pour moi après un problème d' mercurialinstallation.
— tigerjack89

-1

Essaye ça:

mount -t proc proc /proc

Cela a fonctionné pour moi.


Pouvez-vous ajouter une explication sur pourquoi c'est une solution?
— Igor V.
En utilisant notre site, vous reconnaissez avoir lu et compris notre politique liée aux cookies et notre politique de confidentialité.
Licensed under cc by-sa 3.0 with attribution required.