apt-get break:没有名为debian.deb822的模块


21

sys.path:

['/usr/lib/update-notifier'、'/usr/local/lib/python26.zip'、'/usr/local/lib/python2.6'、'/usr/local/lib/python2.6/ plat-linux3”,“ / usr / local / lib / python2.6 / lib-tk”,“ / usr / local / lib / python2.6 / lib-old”,“ / usr / local / lib / python2.6” /lib-dynload'、'/usr/local/lib/python2.6/site-packages']
terry@terrylaptop:/usr/lib$ sudo apt-get install python-debian
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-debian is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 239 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up update-notifier-common (0.119ubuntu8.6) ...
Traceback (most recent call last):
  File "/usr/lib/update-notifier/package-data-downloader", line 26, in <module>
    import debian.deb822
ImportError: No module named debian.deb822
dpkg: error processing update-notifier-common (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of flashplugin-installer:
 flashplugin-installer depends on update-notifier-common (>= 0.119ubuntu2); however:
  Package update-notifier-common is not configured yet.
dpkg: error processing flashplugin-installer (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
   Errors were encountered while processing:
 update-notifier-common
 flashplugin-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)

每当我尝试使用apt-get install更新我的Ubuntu时,都会发生此问题。我在12.04.01 LTS上。

我还通过以下链接安装了python-debian:http : //pkgs.org/ubuntu-12.04/ubuntu-main-i386/python-debian_0.1.21ubuntu1_all.deb.html 但这不起作用。

有人可以帮我吗?非常感谢你。我用谷歌搜索,但似乎应该已经在旧版本中修复了。

terry@terrylaptop:/usr/lib$ sudo apt-get install dolphin
Reading package lists... Done
Building dependency tree       
Reading state information... Done
dolphin is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 239 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up update-notifier-common (0.119ubuntu8.6) ...
['/usr/lib/update-notifier', '/usr/local/lib/python26.zip', '/usr/local/lib/python2.6', '/usr/local/lib/python2.6/plat-linux3', '/usr/local/lib/python2.6/lib-tk', '/usr/local/lib/python2.6/lib-old', '/usr/local/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/site-packages']
Traceback (most recent call last):
  File "/usr/lib/update-notifier/package-data-downloader", line 29, in <module>
    import debian.deb822
ImportError: No module named debian.deb822
dpkg: error processing update-notifier-common (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of flashplugin-installer:
 flashplugin-installer depends on update-notifier-common (>= 0.119ubuntu2); however:
  Package update-notifier-common is not configured yet.
dpkg: error processing flashplugin-installer (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error   from a previous failure.
                                                                                                          Errors were encountered while processing:
 update-notifier-common
 flashplugin-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
terry@terrylaptop:/usr/lib$ ls /usr/local/lib/python2.6/debian.deb822.py 
/usr/local/lib/python2.6/debian.deb822.py

terry@terrylaptop:/usr/lib$ cat /usr/local/lib/python2.6/debian.deb822.py
import warnings

warnings.warn("please use 'debian.deb822' instead", DeprecationWarning,
              stacklevel=2)

from debian.deb822 import *

您可以在/usr/local/lib/python2.6中看到该debian.deb822,但仍然找不到它。

------最新更新于2/20 ----------------

terry@terrylaptop:/usr/local/bin$ ls -l /usr/bin/py*
-rwxr-xr-x 1 root root  3752 May  2  2012 /usr/bin/py3_compilefiles
-rwxr-xr-x 1 root root 97759 May  2  2012 /usr/bin/pycentral
-rwxr-xr-x 1 root root  4124 Apr 18  2012 /usr/bin/pyclean
-rwxr-xr-x 1 root root 11933 Apr 18  2012 /usr/bin/pycompile
-rwxr-xr-x 1 root root  3723 May  2  2012 /usr/bin/py_compilefiles
lrwxrwxrwx 1 root root     8 Apr 27  2012 /usr/bin/pydoc -> pydoc2.7
-rwxr-xr-x 1 root root    79 Aug  1  2012 /usr/bin/pydoc2.7
lrwxrwxrwx 1 root root    12 Apr 27  2012 /usr/bin/pygettext -> pygettext2.7
-rwxr-xr-x 1 root root 22103 Aug  1  2012 /usr/bin/pygettext2.7
-rwxr-xr-x 1 root root   217 Mar  9  2012 /usr/bin/pyhtmlizer
lrwxrwxrwx 1 root root    24 Feb 20 07:24 /usr/bin/python -> /usr/loca/bin/python2.7
lrwxrwxrwx 1 root root    24 Jun 14  2012 /usr/bin/python2 -> /usr/local/bin/python2.6
lrwxrwxrwx 1 root root    24 Jun 14  2012 /usr/bin/python2.6 -> /usr/local/bin/python2.6
lrwxrwxrwx 1 root root    29 Apr 27  2012 /usr/bin/pyversions -> ../share/python/pyversions.py

terry@terrylaptop:/usr/local/bin$ ls -l /usr/local/bin/py*
-rwxrwxr-x 1 root root      84 Feb 20 07:21 /usr/local/bin/pydoc
lrwxrwxrwx 1 root root      24 Feb 20 07:31 /usr/local/bin/python -> /usr/local/bin/python2.7
lrwxrwxrwx 1 root root       9 Feb 20 07:23 /usr/local/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 4610075 Jun 14  2012 /usr/local/bin/python2.6
-rwxr-xr-x 1 root root    1424 Jun 14  2012 /usr/local/bin/python2.6-config
-rwxr-xr-x 1 root root 4917197 Feb 20 07:22 /usr/local/bin/python2.7
-rwxr-xr-x 1 root root    1624 Feb 20 07:23 /usr/local/bin/python2.7-config
lrwxrwxrwx 1 root root      16 Feb 20 07:23 /usr/local/bin/python2-config -> python2.7-config
lrwxrwxrwx 1 root root      14 Feb 20 07:23 /usr/local/bin/python-config -> python2-config

我仍然无法安装。sys.path是:

['/usr/lib/update-notifier', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux2', '/usr/local/lib/python2.7/lib-tk', '/usr/local/lib/python2.7/lib-old', '/usr/local/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']

------ 2013/2/22更新---------------

terry@terrylaptop:/data$ sudo apt-get install python2.7
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python2.7 is already the newest version.
The following packages were automatically installed and are no longer required:
  libnepomukdatamanagement4 libkexiv2-10 libkdegames5a libboost-program-options1.46.1 libkdecorations4 libkwinglutils1 libnepomuksync4  libokularcore1abi1 libssl0.9.8 libattica0.3 liblastfm0 libkwineffects1abi3
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.

为什么会这样:“ 0升级,0新安装,0删除和239未升级 ”?

@ vasa1,因为它已经安装,或者因为软件包管理器已损坏。啊,看起来多了几行,我们看到软件包管理器坏了。通过包管理器升级后,我们将无法修复包管理器。我们将必须下载修复程序并手动对其进行修补。
ctrl-alt-delor

在安装非Debian软件包时,它会做同样的事情吗?如果是这样,您可以更新问题,使其更通用。(您可能会得到更多答案)。
ctrl-alt-delor

从9.10-> 10.04升级到现在的12.04的服务器上,存在完全相同的问题。我没有进行升级,所以我不知道它在哪里破裂,应该手动修复它,因为它只是缺少一个python模块(参考12.04系统具有“ /usr/lib/python2.7/dist-packages/debian” –包含指向“ / usr / share / pyshared”,deb822等各个模块的链接,而在损坏的系统上,debian文件夹不存在
Ernelli 2013年

嗨,我添加了更多的调试信息,以便更好:
Terry

Answers:


16

尝试重新安装应该包含debian.deb822的软件包:

sudo apt-get --reinstall install python-debian

14

在我而言,我不得不卸载所有冲突的包,比如update-notifierupdate-notifier-common等等,然后我跑:

sudo apt install --reinstall python-debian python3-debian python-chardet python3-chardet

2
这是只有想其他所有的工作后,我的解决方案(包括与此:askubuntu.com/questions/812375/...
slhck

这个答案也对我有用。我在安装python3之后不久就开始收到此错误... update-notifier发现python3的存在,但由于缺少必需的依赖项而无法完成。我不得不跑步sudo apt install python3-debian python3-chardet python3-six,一切都很好。
theJoeBiz '17

8

我使用apt-get remove命令删除update-notifier-commonflashplugin-installer然后解决问题。

这是命令:

sudo apt-get remove  update-notifier-common flashplugin-installer

是的,但是这更像是一种解决方法,然后您没有更新闪存,也没有更新通知程序
Huafu 2014年

做得太好了。这仍然有效。
Akash Kandpal

5

我同时安装了python 2.6和2.7,因此我需要切换回具有debian.deb822的2.7

sudo update-alternatives --config python

这对我也有用,我在14.04
Huafu

3

您可能已删除python debian软件包,请运行以下命令以重新安装python-debian,然后安装update-notifier软件包。

sudo apt-get remove  update-notifier-common
sudo apt-get autoremove
sudo apt-get --reinstall install python-debian
sudo apt-get install  update-notifier

3

就我而言,在ubuntu 16.04上修复它的问题(自原始发布以来,这个问题仍然存在很多年)是修复python符号链接:

cd /usr/bin
sudo ln -sf python3.6 python3
sudo ln -sf python3 python

所以现在我有:

/usr/bin# ls -l python python3
lrwxrwxrwx 1 root root 7 Jun 29 15:33 python -> python3
lrwxrwxrwx 1 root root 9 Jun 29 15:38 python3 -> python3.6

以前python3是指向python3.5。一旦我重新链接它可以python3.6 apt再次工作。

目前,我并排安装了python 2.7、3.5和3.6。


为我解决了。安装后出现了问题,python3.7python3指向的python3.7不是python3.6
Emonadeo

2

我的解决方案

apt-get --reinstall install python-chardet

问题剖析

在我的平台上dpkg -L python-chardet声称python-chardet将使用以下文件:

# dpkg -L python-chardet
/.
/usr
/usr/share
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/chardet.1.gz
/usr/share/doc
/usr/share/doc/python-chardet
/usr/share/doc/python-chardet/history.html
/usr/share/doc/python-chardet/css
/usr/share/doc/python-chardet/css/chardet.css
/usr/share/doc/python-chardet/faq.html
/usr/share/doc/python-chardet/images
/usr/share/doc/python-chardet/images/tip.png
/usr/share/doc/python-chardet/images/note.png
/usr/share/doc/python-chardet/images/permalink.gif
/usr/share/doc/python-chardet/images/warning.png
/usr/share/doc/python-chardet/images/caution.png
/usr/share/doc/python-chardet/images/important.png
/usr/share/doc/python-chardet/index.html
/usr/share/doc/python-chardet/how-it-works.html
/usr/share/doc/python-chardet/usage.html
/usr/share/doc/python-chardet/license.html
/usr/share/doc/python-chardet/changelog.Debian.gz
/usr/share/doc/python-chardet/copyright
/usr/share/doc/python-chardet/supported-encodings.html
/usr/bin
/usr/bin/chardet
/usr/lib
/usr/lib/python2.7
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/chardet
/usr/lib/python2.7/dist-packages/chardet/langcyrillicmodel.py
/usr/lib/python2.7/dist-packages/chardet/mbcharsetprober.py
/usr/lib/python2.7/dist-packages/chardet/test.py
/usr/lib/python2.7/dist-packages/chardet/charsetgroupprober.py
/usr/lib/python2.7/dist-packages/chardet/utf8prober.py
/usr/lib/python2.7/dist-packages/chardet/langgreekmodel.py
/usr/lib/python2.7/dist-packages/chardet/hebrewprober.py
/usr/lib/python2.7/dist-packages/chardet/langhebrewmodel.py
/usr/lib/python2.7/dist-packages/chardet/escprober.py
/usr/lib/python2.7/dist-packages/chardet/mbcssm.py
/usr/lib/python2.7/dist-packages/chardet/jpcntx.py
/usr/lib/python2.7/dist-packages/chardet/codingstatemachine.py
/usr/lib/python2.7/dist-packages/chardet/gb2312prober.py
/usr/lib/python2.7/dist-packages/chardet/latin1prober.py
/usr/lib/python2.7/dist-packages/chardet/euctwprober.py
/usr/lib/python2.7/dist-packages/chardet/escsm.py
/usr/lib/python2.7/dist-packages/chardet/universaldetector.py
/usr/lib/python2.7/dist-packages/chardet/langbulgarianmodel.py
/usr/lib/python2.7/dist-packages/chardet/gb2312freq.py
/usr/lib/python2.7/dist-packages/chardet/langthaimodel.py
/usr/lib/python2.7/dist-packages/chardet/constants.py
/usr/lib/python2.7/dist-packages/chardet/eucjpprober.py
/usr/lib/python2.7/dist-packages/chardet/euctwfreq.py
/usr/lib/python2.7/dist-packages/chardet/jisfreq.py
/usr/lib/python2.7/dist-packages/chardet/sbcharsetprober.py
/usr/lib/python2.7/dist-packages/chardet/mbcsgroupprober.py
/usr/lib/python2.7/dist-packages/chardet/__init__.py
/usr/lib/python2.7/dist-packages/chardet/sjisprober.py
/usr/lib/python2.7/dist-packages/chardet/euckrprober.py
/usr/lib/python2.7/dist-packages/chardet/langhungarianmodel.py
/usr/lib/python2.7/dist-packages/chardet/charsetprober.py
/usr/lib/python2.7/dist-packages/chardet/chardistribution.py
/usr/lib/python2.7/dist-packages/chardet/sbcsgroupprober.py
/usr/lib/python2.7/dist-packages/chardet/big5freq.py
/usr/lib/python2.7/dist-packages/chardet/big5prober.py
/usr/lib/python2.7/dist-packages/chardet/euckrfreq.py
/usr/lib/python2.7/dist-packages/chardet-2.0.1.egg-info

但问题是这些都不存在:

# ls /usr/lib/python2.7/dist-packages/chardet
ls: cannot access /usr/lib/python2.7/dist-packages/chardet: No such file or directory

您可以做的另一项测试

您还可以使用二进制文件来检查chardet:

/usr/bin/chardet

如果输出类似这样的内容,则说明lib已损坏

# /usr/bin/chardet 
Traceback (most recent call last):
  File "/usr/bin/chardet", line 26, in <module>
    import chardet
ImportError: No module named chardet

我的原始错误消息:

root@odroid:/etc/nagios# apt-get install  update-notifier             
Reading package lists... Done Building dependency tree        Reading
state information... Done update-notifier is already the newest
version. 0 upgraded, 0 newly installed, 0 to remove and 5 not
upgraded. 4 not fully installed or removed. After this operation, 0 B
of additional disk space will be used. Do you want to continue? [Y/n] 
Setting up update-notifier-common (0.154.1ubuntu1) ... Traceback (most
recent call last):   File
"/usr/lib/update-notifier/package-data-downloader", line 26, in
<module>
    import debian.deb822   File "/usr/lib/python2.7/dist-packages/debian/deb822.py", line 39
    import chardet
         ^ SyntaxError: invalid syntax dpkg: error processing package update-notifier-common (--configure):  subprocess installed
post-installation script returned error exit status 1 dpkg: dependency
problems prevent configuration of update-notifier:  update-notifier
depends on update-notifier-common (= 0.154.1ubuntu1); however:  
Package update-notifier-common is not configured yet.

dpkg: error processing package update-notifier (--configure): 
dependency problems - leaving unconfigured dpkg: dependency problems
prevent configuration of update-manager:  update-manager depends on
update-notifier; however:   Package update-notifier is not configured
yet.

dpkg: error processing package update-manager (--configure): 
dependency problems - leaving unconfigured dpkg: dependency problems
prevent configuration of ubuntu-release-upgrader-gtk: 
ubuntu-release-upgrader-gtk depends on update-manager; however:  
Package update-manager is not configured yet.

dpkg: error processing package ubuntu-release-upgrader-gtk
(--configure):  depenNo apport report written because the error
message indicates its a followup error from a previous failure.
                                                                                                                No apport report written because the error message indicates its a
followup error from a previous failure.
                                                                   No apport report written because MaxReports is reached already
                                                                                                                                 dency problems - leaving unconfigured Errors were encountered while
processing:  update-notifier-common  update-notifier  update-manager 
ubuntu-release-upgrader-gtk E: Sub-process /usr/bin/dpkg returned an
error code (1)

所以正如我上面所说,只需重新安装chardet:

apt-get --reinstall install python-chardet

我实际上不喜欢Volker Siegel的编辑。我故意使用小写。
qknight 2015年

0

对我来说,这是通过安装以下python-debian软件包来解决的python3

sudo apt install python3-debian
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.