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
, вы также можете проверить чарте, используя двоичный файл:
/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)
, как я уже сказал, просто переустановить чарт:
apt-get --reinstall install python-chardet