Jak rozwiązać problem „dpkg: przetwarzanie błędów /var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb”?


47

Menedżer aktualizacji nie zaktualizuje się, mimo że mam ponad 100 aktualizacji do zainstalowania. Pojawia się następujący komunikat o błędzie:

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

Trwa to już od dwóch tygodni i nie mogę uzyskać żadnych aktualizacji. Każda pomoc byłaby świetna.


1
Dodaj 4 spacje przed każdym wierszem „wynik”. Potwierdź, która wersja Ubuntu .
david6

1
@ david6 Wygląda na to, że używa 12.04. Chyba że używa pakietów Precise w Oneiric lub innej wersji. (wskazówka: między innymi wersja gnome-orca to 3.4)
jokerdino

Próbowałem edytować tytuł, aby był bardziej szczegółowy, i mogłem dodać tag 12.04. Jeśli ktoś z was się nie zgadza, prosimy o odpowiednią edycję.
jokerdino

1
Wersja raportu z python-problem-raport jest częścią dokładnego wydania SRU apport 4 czerwca
John S Gruber

Odpowiedzi:


61

Musisz wymusić zastąpienie plików powodujących błędy:

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

W twoim przypadku będzie to:

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

Następnie uruchomić:

sudo apt-get -f install

Źródło: http://www.absolutelytech.com/2010/06/30/solved-error-dpkg-error-processing-filename-unpack-trying-to-overwrite/


1
Miałem podobne problemy z uzyskaniem nadrzędnego błędu i uruchomieniem sudo dpkg -i --force-overwrite <nazwa pliku> to naprawiłem. Dzięki!
Mike Grace

1
+1 od dawna miałem do czynienia z tym problemem wina w moim systemie operacyjnym Ubuntu16.04. rozwiązany teraz. dziękuję za twoją cenną odpowiedź.
Satish Sharma

1
+1 To powstrzymuje lxqt codziennie ppa narzeka na moje nadużycia.
Dominic Cerisano

38

Możesz spróbować wykonać następujące polecenie:

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

Jeśli nadal występuje ten sam błąd, spróbuj:

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

Nawet jeśli to nie zadziała i nadal pojawia się ten sam błąd, sprawdź ponownie, a my możemy to rozwiązać.


Miałem podobny problem z E: Problem ze zmianą nazwy pliku /var/cache/apt/pkgcache.bin.random. Wypróbowałem pierwsze podejście i zadziałało to doskonale.
Starszy Geek,

1
Nie miało to dla mnie żadnego efektu. Nadal pojawia się mnóstwo błędów, takich jak „dpkg: problemy z zależnością uniemożliwiają konfigurację *”
Cerin

1
Co sudo dpkg --configure -ato znaczy
Parag Jadhav

5

Może to być błąd w pakiecie python-problem-raport lub pakiet minimalny python lub zła kopia pakietu.

Widzę, że jest to pakiet precyzyjnie zaproponowany. Możesz usunąć to repozytorium z listy źródeł oprogramowania i wykonać apt-get updatesesję terminalową ( Ctrl- Alt- T) w celu odzyskania.

Możesz także spróbować usunąć python-problem-report_2.0.1-0ubuntu9_all.debz, /var/cache/apt/archiveswięc apt-get upgradebędziesz musiał ponownie pobrać nową kopię. W terminalu ( Ctrl- Alt- T) wpisz:

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

Alternatywnie możesz użyć:

sudo apt-get clean

aby usunąć wszystkie pobrane pliki z pamięci podręcznej.

Spróbuj uaktualnienia ponownie.

Jeśli żadna z tych pomocy nie powinna pozostawić komentarza na stronie https://bugs.launchpad.net/ubuntu/+source/apport/+bug/984944 opisujący twoje doświadczenia związane z korzystaniem z tego proponowanego pakietu lub po jego ogólnym wydaniu, plik błąd w pakiecie apport.

Zostawiłem jeden komentarz na temat tego pytania na https://bugs.launchpad.net/ubuntu/+source/apport/+bug/984944, ale powinieneś dodać komentarz opisujący kroki, które przeszedłeś i wyniki z apt- dostać aktualizację z góry.


2
Chociaż masz rację, jeśli chodzi o pieniądze, w których prawdopodobnie jest to błąd python-problem-report, nie polecam sudo rmpolecenia. To zdecydowanie powinno być ostatecznością. Dobra robota inaczej!
jokerdino

Tak długo, jak sudo rm ...polecenie nie jest źle wpisane, powinno być w porządku i nie musi być traktowane jako ostateczność: pliki w /var/cache/apt/archivessą tylko zarchiwizowanymi (tzn. Pozostawionymi) plikami pakietu. Jak mówi John S Gruber, nieco zalecane sudo apt-get cleanpolecenie usuwa wszystkie te pliki. Usunięcie buforowanego pliku .deb to bezpieczny i skuteczny sposób zapewnienia, że ​​nowy (i miejmy nadzieję, że nie zostanie uszkodzony) plik .deb musi zostać pobrany przy następnej instalacji (lub ponownej instalacji) pakietu.
Eliah Kagan

Nie działało dla mnie
Hack-R

5
sudo update-alternatives --config python

Istnieją 2 opcje dla alternatywnego Pythona (zapewniającego / 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: 

Wybierz opcję python2.7.


2

Alternatywnie możesz spróbować usunąć pakiet i dodać go później. To działało dla mnie na kliencie Citrix. Uważaj na to, co usuwasz (oczywiście).

sudo apt-get remove icaclient:i386

1

Podobny problem spotkałem w systemie, w którym zainstalowano zarówno Python 2.7, jak i Python 3.4. Problemem był problem ze zgodnością z pakietem python-subversion , który najwyraźniej działa tylko z python 2 ze względu na zmianę w ConfigParser . Zajęłam się tym, robiąc

ls -la /usr/bin | grep python

Aby potwierdzić, że plik wykonywalny Pythona na mojej ścieżce był dowiązaniem symbolicznym do Pythona 3. Wtedy

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

Aby zamiast tego użyć Pythona 2. Po tym apt-get był w stanie zakończyć się normalnie i cofnąłem zmianę dowiązania symbolicznego.

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

Ostatnie 2 polecenia można zastąpić ln -rs /usr/bin/python3.4 /usr/bin/python. Ponadto, jeśli masz już inne dowiązanie symboliczne /usr/bin/python3wskazujące na najnowszą python3wersję, jak to zwykle bywa, możesz zrobić kolejny krok naprzód ln -rs /usr/bin/python3 /usr/bin/python. W każdym razie, dzięki za rozwiązanie, zadziałało dla mnie po problemie w mercurialinstalacji.
tigerjack89

Korzystając z naszej strony potwierdzasz, że przeczytałeś(-aś) i rozumiesz nasze zasady używania plików cookie i zasady ochrony prywatności.
Licensed under cc by-sa 3.0 with attribution required.