apt-get broken : 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, 이미 설치되었거나 패키지 관리자가 손상 되었기 때문입니다. Ahh 몇 줄 더 보시면 패키지 관리자가 깨졌습니다. 패키지 관리자를 통해 패키지 관리자를 업그레이드 할 수 없습니다. 수정 사항을 다운로드하여 수동으로 패치해야합니다.
ctrl-alt-delor

비 데비안 꾸러미를 설치할 때도 마찬가지입니까? 그렇다면 질문을 더 일반적으로 만들기 위해 업데이트 할 수 있습니다. (더 많은 답변을 얻을 수 있습니다).
ctrl-alt-delor

우리는 9.10-> 10.04에서 12.04로 업그레이드 한 서버에서 정확히 같은 문제가 발생 했으며이 문제가 발생했습니다. 나는 업그레이드를하지 않았으므로 어디에서 고장 났는지 알지 못한다. 파이썬 모듈이 없기 때문에 수동으로 쉽게 수정해야한다 (참조 12.04 시스템에는 "/usr/lib/python2.7/dist-packages/debian" "/ usr / share / pyshared"의 다양한 모듈에 대한 링크를 포함하고 있으며, deb822는 손상된 시스템에서 데비안 폴더가없는 상태입니다.
Ernelli

안녕하세요, 더 나은 디버그 정보를 추가했습니다 :
Terry

답변:


16

debian.deb822를 포함하고있는 패키지를 다시 설치하십시오 :

sudo apt-get --reinstall install python-debian

14

내 경우에는 내가 좋아하는 모든 충돌 패키지를 제거했다 update-notifier, update-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

8

apt-get remove 명령을 사용하여 update-notifier-common , flashplugin-installer를 제거한 다음 문제 해결 방법 을 제거하십시오 .

명령은 다음과 같습니다.

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

예, 그러나 이것은 해결 방법과 비슷하며 플래시 업데이트도 없습니다. 더 이상 업데이트 알리미도 없습니다
Huafu

잘 했어요. 이것은 여전히 ​​작동합니다.
Akash Kandpal 5

5

파이썬 2.6과 2.7을 모두 설치 했으므로 debian.deb가있는 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

제 경우에는 우분투 16.04에서 수정 한 문제는 (원래 게시물 이후 몇 년 동안 여전히 문제가됩니다) 파이썬 심볼릭 링크를 수정하는 것입니다.

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위해 다시 연결했습니다 .

현재 파이썬 2.7, 3.5 및 3.6을 나란히 설치했습니다.


나를 위해 해결했습니다. 내가 설치 한 후 문제를 가지고 python3.7있었다 python3에 지점을 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

0

나를 위해 python-debian패키지를 설치하여 해결되었습니다 python3.

sudo apt install python3-debian
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.