Bagaimana mengatasi “dpkg: pemrosesan kesalahan /var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb”?

47

Update Manager tidak akan memperbarui walaupun saya memiliki lebih dari 100 pembaruan untuk diinstal. Saya mendapatkan pesan kesalahan seperti ini:

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

Ini telah berlangsung selama dua minggu sekarang dan saya tidak bisa mendapatkan pembaruan apa pun. Bantuan apa pun akan bagus.

raz7588
sumber
1
Silakan tambahkan 4 spasi sebelum setiap baris 'output'. Harap konfirmasi versi Ubuntu mana .
david6
1
@ david6 Sepertinya dia menggunakan 12.04. Kecuali dia menggunakan paket Precise dalam Oneiric atau versi rilis lainnya. (isyarat: versi gnome-orca adalah 3.4 antara lain)
jokerdino
Saya mencoba mengedit judul menjadi lebih spesifik dan mengambil kebebasan untuk menambahkan tag 12,04. Jika ada di antara Anda yang tidak setuju, jangan ragu untuk mengeditnya.
jokerdino
1
Versi python-problem-report adalah bagian dari rilis SRU yang tepat pada 4 Juni.
John S Gruber

Jawaban:

61

Anda harus memaksa menimpa file yang menyebabkan kesalahan:

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

Dalam kasus Anda, itu akan menjadi:

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

Lalu lari:

sudo apt-get -f install

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

David Lartey
sumber
1
Saya mengalami masalah serupa dengan mendapatkan kesalahan masalah utama dan menjalankan sudo dpkg -i - force-overwrite <filename> memperbaikinya. Terima kasih!
Mike Grace
1
+1 saya menghadapi masalah anggur ini di OS ubuntu16.04 saya sejak lama. itu diselesaikan sekarang. terima kasih atas jawaban Anda yang berharga.
Satish Sharma
1
+1 Ini berhenti setiap hari ppa mengeluh tentang penyalahgunaan saya.
Dominic Cerisano
38

Anda dapat mencoba perintah berikut:

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

Jika Anda masih berakhir dengan kesalahan yang sama, coba:

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

Bahkan jika itu tidak berhasil dan Anda masih mendapatkan kesalahan yang sama, periksa kembali dan kami dapat menyelesaikannya.

jokerdino
sumber
Saya punya masalah yang sama dengan E: Masalah mengubah nama file /var/cache/apt/pkgcache.bin.random chars. Mencoba pendekatan pertama dan itu berhasil dengan baik.
Penatua Geek
1
Ini tidak berpengaruh bagi saya. Saya masih mendapatkan banyak kesalahan seperti "dpkg: masalah dependensi mencegah konfigurasi *"
Cerin
1
Apa artinya sudo dpkg --configure -aini?
Parag Jadhav
5

Mungkin bug di paket python-masalah-laporan atau paket python-minimal atau salinan paket yang buruk.

Saya melihat bahwa ini adalah paket dari usulan yang tepat. Anda mungkin ingin menghapus repositori ini dari daftar sumber perangkat lunak Anda dan menjalankan apt-get updatedari sesi terminal ( Ctrl- Alt- T) untuk memulihkan.

Anda juga dapat mencoba menghapus python-problem-report_2.0.1-0ubuntu9_all.debdari /var/cache/apt/archivessehingga apt-get upgradeharus men-download salinan segar kembali. Di terminal ( Ctrl- Alt- T) ketik:

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

Atau Anda dapat menggunakan:

sudo apt-get clean

untuk menghapus semua file yang diunduh di cache Anda.

Coba upgrade lagi.

Jika tidak satu pun dari bantuan ini Anda harus memberikan komentar di https://bugs.launchpad.net/ubuntu/+source/apport/+bug/984944 yang menjelaskan pengalaman Anda dalam menggunakan paket yang diusulkan ini, atau setelah paket umumnya dirilis, ajukan bug terhadap paket apport.

Saya telah meninggalkan satu komentar tentang pertanyaan ini di https://bugs.launchpad.net/ubuntu/+source/apport/+bug/984944 tetapi Anda harus menambahkan komentar yang menjelaskan langkah-langkah yang telah Anda lalui dan output dari apt- dapatkan peningkatan dari atas.

John S Gruber
sumber
2
Meskipun Anda benar tentang uang yang mungkin merupakan bug python-problem-report, saya tidak nyaman merekomendasikan sudo rmperintah. Itu pasti harus menjadi pilihan terakhir. Sebaliknya, pekerjaan bagus!
jokerdino
Selama sudo rm ...perintah itu tidak salah ketik harus baik-baik saja dan tidak perlu dianggap sebagai pilihan terakhir: file-file di dalam /var/cache/apt/archiveshanya diarsipkan (yaitu, sisa) paket file. Seperti kata John S Gruber, perintah yang agak umum direkomendasikan sudo apt-get cleanmenghapus semua file itu. Menghapus file .deb yang di-cache adalah cara yang aman dan efektif untuk memastikan file .deb yang baru (dan mudah-mudahan tidak rusak) .deb harus diunduh lain kali ketika paket diinstal (atau diinstal ulang).
Eliah Kagan
Tidak bekerja untuk saya
Hack-R
5
sudo update-alternatives --config python

Ada 2 pilihan untuk python alternatif (menyediakan / 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: 

Pilih opsi python2.7.

Francisco Oliveira
sumber
2

Sebagai alternatif, Anda dapat mencoba menghapus paket dan menambahkannya setelahnya. Ini bekerja untuk saya di klien Citrix. Berhati-hatilah dengan apa yang Anda hapus (tentu saja).

sudo apt-get remove icaclient:i386
Bart Blommaerts
sumber
1

Saya mengalami masalah serupa pada sistem yang memiliki python 2.7 dan python 3.4 diinstal. Masalahnya adalah masalah kompatibilitas dengan paket python-subversi , yang tampaknya hanya berfungsi dengan python 2 karena perubahan dalam ConfigParser . Saya mengatasinya dengan melakukan

ls -la /usr/bin | grep python

Untuk mengonfirmasi bahwa python yang dapat dieksekusi di jalur saya adalah symlink ke python 3. Lalu

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

Untuk menggunakan python 2 sebagai gantinya. Setelah itu apt-get dapat menyelesaikan secara normal, dan saya mengembalikan perubahan symlink saya.

rm -f /usr/bin/python
ln -s /usr/bin/python3.4 /usr/bin/python
TD Smith
sumber
2 perintah terakhir dapat diganti dengan ln -rs /usr/bin/python3.4 /usr/bin/python. Juga, jika Anda sudah memiliki symlink lain yang /usr/bin/python3menunjuk ke python3rilis terbaru , seperti yang biasanya terjadi, Anda dapat membuat langkah maju dengan ln -rs /usr/bin/python3 /usr/bin/python. Bagaimanapun, terima kasih atas solusinya, itu berhasil untuk saya setelah masalah dalam mercurialinstalasi.
tigerjack89
-1

Coba ini:

mount -t proc proc /proc

Itu berhasil untuk saya.

pengguna414320
sumber
Bisakah Anda menambahkan penjelasan mengapa ini solusi?
Igor V.