如何解决“ dpkg:错误处理/var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb”?


47

即使我要安装100多个更新,Update Manager也不会更新。我收到这样的错误消息:

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

现在已经进行了两个星期,我无法获得任何更新。任何帮助都会很棒。


1
请在“输出”的每一行之前添加4个空格。请确认哪个Ubuntu版本。
david6 2012年

1
@ david6看起来他在使用12.04。除非他使用Oneiric或其他发行版中的Precise软件包。(提示:gnome-orca版本为3.4,等等)
jokerdino

我尝试编辑标题以使其更加具体,并自由添加了12.04标签。如果任何人不同意,请随时进行相应的编辑。
jokerdino

1
蟒蛇-问题报告的版本是一个精确的Apport会SRU发布6月4日的一部分
约翰·格鲁伯小号

Answers:


60

您需要强制覆盖导致错误的文件:

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

在您的情况下,它将是:

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

然后运行:

sudo apt-get -f install

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


1
我遇到了类似的问题,即遇到了严重的问题错误并运行sudo dpkg -i --force-overwrite <filename>修复了该问题。谢谢!
Mike Grace

1
+1很长时间以来,我就在ubuntu16.04操作系统中遇到了这个葡萄酒问题。现在解决了。感谢您的宝贵答复。
Satish Sharma

1
+1这样可以阻止lxqt每天的PPA抱怨我的虐待行为。
Dominic Cerisano

38

您可以尝试以下命令:

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

如果仍然遇到相同的错误,请尝试:

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

即使那行不通,并且您仍然遇到相同的错误,请再次检查,我们可以解决此问题。


我在E:Problem重命名文件/var/cache/apt/pkgcache.bin.random chars时遇到了类似的问题。尝试了第一种方法,并且效果很好。
年长者怪胎

1
这对我没有影响。我仍然收到大量错误,例如“ dpkg:依赖性问题阻止*的配置”
Cerin 2016年

1
sudo dpkg --configure -a这是什么意思?
Parag Jadhav

5

可能是python-problem-report包或python-minimal包中的错误,或者是该包的错误副本。

我看到这是精确建议的程序包。您可能希望从软件源列表中删除这个软件库和执行apt-get update从终端会话(Ctrl- - AltT恢复。

您也可以尝试python-problem-report_2.0.1-0ubuntu9_all.deb从中删除,/var/cache/apt/archives因此apt-get upgrade必须再次下载新副本。在终端(Ctrl- - AltT类型:

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

或者,您可以使用:

sudo apt-get clean

清除缓存中所有下载的文件。

再次尝试升级。

如果以上两种方法均无济于事,则应在https://bugs.launchpad.net/ubuntu/+source/apport/+bug/984944上发表评论,以描述您使用此建议软件包的经验,或者一旦该软件包通常发布,请归档针对apport包的错误。

我已经在https://bugs.launchpad.net/ubuntu/+source/apport/+bug/984944上留下了关于此问题的一条评论,但您应该添加一条评论,描述您已完成的步骤以及apt-的输出。从上面获得升级。


2
虽然您对它可能是一个bug的金钱是正确的,但python-problem-report我不推荐使用此sudo rm命令。那绝对应该是最后的手段。否则做得好!
jokerdino

只要sudo rm ...不键入错误的命令,它就可以了,也不必视为万不得已:文件中/var/cache/apt/archives的文件只是归档(即遗留)的软件包文件。正如约翰·格鲁伯(John S Gruber)所说,通常被推荐的sudo apt-get clean命令将删除所有这些文件。删除缓存的.deb文件是一种安全有效的方法,可确保在下次安装(或重新安装)软件包时必须下载新的(希望没有损坏的).deb文件。
伊利亚·卡根

我没有工作
哈克-R

5
sudo update-alternatives --config python

替代python有2个选择(提供/ 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: 

选择选项python2.7。


2

或者,您可以尝试删除软件包,然后再添加。这在Citrix客户端上对我有用。请小心要删除的内容(当然)。

sudo apt-get remove icaclient:i386

1

我在同时安装了python 2.7和python 3.4的系统上遇到了类似的问题。问题是软件包python-subversion的兼容性问题,由于ConfigParser的更改,该软件包显然仅适用于python 2 。我通过做解决

ls -la /usr/bin | grep python

确认我路径上的python可执行文件是到python 3的符号链接。然后

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

要改用python 2。在该apt-get能够正常完成之后,我恢复了我的符号链接更改。

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

最后2个命令可以替换为ln -rs /usr/bin/python3.4 /usr/bin/python。另外,如果您已经有了另一个/usr/bin/python3指向最新python3版本的符号链接(通常会发生这种情况),则可以使用进行下一步ln -rs /usr/bin/python3 /usr/bin/python。无论如何,感谢您的解决方案,它在mercurial安装出现问题后为我工作。
tigerjack89

-1

尝试这个:

mount -t proc proc /proc

它为我工作。


您能否添加一个关于为什么这是解决方案的解释?
Igor V.
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.