& ldquo; TypeError: тип str не поддерживает буферный API & rdquo; при настройке gconf

«Возникла проблема при проверке обновлений». Я заметил красный кружок с белой линией как минимум неделю. Не уверен, что это связано с версией Python, на которую я сменил или обновил, которая была вырезана в середине. Итог я не могу зайти в свои репозитории и многое другое. Щелчок правой кнопкой мыши на красном круге со светом показывает некоторые параметры, такие как установка всех обновлений, но ни один из них не отвечает.

Я изучил предыдущие замечания по поводу этой проблемы, но, похоже, ни одно из них еще не решило эту проблему.

Вот результат выполнения

sudo apt-get -f install 

E: Sub-process /usr/bin/dpkg returned an error code (1)
eyal@eyal:~$ sudo apt-get -f install
Reading package lists...Done
eyal@eyal:~$ sudo apt-get -f install
Reading package lists...Done
Building dependency tree

Reading state information...Done
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up ipython (0.10.2-1) ...

Traceback (most recent call last):

File "/usr/bin/pycompile", line 36, in <module>

from debpython.version import SUPPORTED, debsorted, vrepr, \

File "/usr/share/python/debpython/version.py", line 24, in <module>

from ConfigParser import SafeConfigParser

ImportError: No module named ConfigParser

dpkg: error processing ipython (--configure):

subprocess installed post-installation script returned error exit status 1
No apport writen becaouse MaxReports is reached already

Errors were encountered while processing:
ipython

Я выполнил обновление и попытался установить пакеты:

Reading package lists...
  Building dependency tree...
  Reading state information...
  0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  3 not fully installed or removed.
  After this operation, 0 B of additional disk space will be used.
  Setting up gconf2 (3.2.3-0ubuntu0.1) ...
  Traceback (most recent call last):
  File "/usr/sbin/gconf-schemas", line 120, in <module>
    trim(os.path.join(defaults_dest,"%gconf-tree.xml"), get_valid_languages())
  File "/usr/sbin/gconf-schemas", line 18, in get_valid_languages
    langs.add(l.split('_')[0])
 TypeError: Type str doesn't support the buffer API
 dpkg: error processing gconf2 (--configure):
 subprocess installed post-installation script returned error exit status 1
 Setting up ipython (0.10.2-1) ...
 Traceback (most recent call last):
  File "/usr/bin/pycompile", line 36, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
 ImportError: No module named ConfigParser
 dpkg: error processing ipython (--configure):
 subprocess installed post-installation script returned error exit status 1
 dpkg: dependency problems prevent configuration of compiz-plugins-main-default:
 compiz-plugins-main-default depends on gconf2 (>= 2.28.1-2); however:
  Package gconf2 is not configured yet.
 dpkg: error processing compiz-plugins-main-default (--configure):
 dependency problems - leaving unconfigured
 Errors were encountered while processing:
 gconf2
 ipython
 compiz-plugins-main-default
 E: sub-process /usr/bin/dpkg returned an error code(1)

    E: Sub-process /usr/bin/dpkg returned an error code (1)

Похоже, что основная проблема исходит: обработка: gconf2 ipython

sudo dpkg --configure gconf2
[sudoo] password for eyal:
setting up conf2 (3.2.3-0ubuntu0.1) ...
Trackback (most recent call last):
 File '/usr/sbin/gconf-schemas", line 120, in <module>
   trim (os.path.join(defaults_dest, "%gconf-tree.xml")
 File '/usr/sbin/gconf-schemas", line 18, in get_valid_languages
 langs.add(l.split('_')[0])
TypeError: type str dosen't support the buffer API
dpkg error: error processing gconf2(--configure):
 subprocess installed post-instalation script returned error exit satus 1
Erros were encountered while processing:
gconf2
3
задан 10 May 2014 в 19:51

4 ответа

У меня точно такая же проблема, вы должны проверить версию Python по умолчанию, на которую указывает ваша система. Некоторое программное обеспечение вынуждает использовать Python 3.2, поэтому я вручную переключаю версию Python.

sudo ln -s /usr/bin/python3.2 /usr/bin/python

Затем я столкнулся с проблемой, которую вы описали здесь, я переключаю ее обратно на 2.7, а затем снова запускаю шаги настройки.

sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
sudo dpkg --configure gconf2

И все идет безупречно ... Надеюсь, это поможет.

0
ответ дан 10 May 2014 в 19:51

Иногда поврежденный установочный пакет может повредить вашу систему управления пакетами, в результате чего Linux не сможет установить или удалить какие-либо пакеты (программное обеспечение). Вот сообщение об ошибке, которое я получил от apt-get после попытки установить ndas-admin для Ubuntu.

$ sudo apt-get install mplayer (или любой пакет) Чтение списков пакетов… Готово Построение дерева зависимостей
Чтение информации о состоянии… Готово E: Необходимо переустановить пакет ndas-admin, но я не могу ' не могу найти архив для него. (это ошибка)

Я попытался: $ sudo apt-get install -f, чтобы исправить проблему, но получил ту же ошибку. Единственным вариантом, который у меня был, было редактирование файла статуса dpkg вручную.

$ sudo gedit /var/lib/dpkg/status    (if you prefer you can use vi instead of gedit)
Locate the corrupt package, and remove the whole block of information about it and save the file. Mine looked like this:

Package: ndas-admin
Status: deinstall reinstreq half-configured
Priority: extra
Section: alien
Installed-Size: 100
Maintainer: root <root@ubuntu510>
Architecture: i386
Version: 1.0.2-24
Depends: libc6 (>= 2.3.4-1)
Description: Administration toosl for XIMETA,Inc NDAS device driver for Linux operating system
 ndas-admin – This program allows the user to register/enable/disable/unregister the XIMETA NDAS hard disk.
 .
 (Converted from a rpm package by alien version 8.53.)

Исправлено. Надеюсь, это поможет кому-то еще.

0
ответ дан 10 May 2014 в 19:51

Не знаю почему, но я столкнулся с подобной проблемой после регулярного обновления системы (Ubuntu 13.10, amd64). Я потратил много времени на поиск в Google, но ничто не помогло мне. Python по умолчанию в системе - версия 2.7. Я обнаружил, что проблема была в том, что каталог / usr / share / python / debpython не существовал после обновления.

Я решил проблему следующим образом:

apt-get download python-minimal
sudo dpkg -i python-minimal_2.7.5-5ubuntu1_amd64.deb
sudo apt-get -f install

и для окончательной проверки, что все в порядке

sudo dpkg --audit
0
ответ дан 10 May 2014 в 19:51

У моего монетного двора были проблемы с:

    Errors were encountered while processing:
       python-m2crypto
       python-sqlite
       python-urlgrabber
       python-yaml
       python-rpm
       osc
       python-iniparse
    E: Sub-process /usr/bin/dpkg returned an error code (1)

Поэтому я проверяю с:

$ sudo dpkg --audit
The following packages are only half configured, probably due to problems
configuring them the first time. The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
 python-yaml          YAML parser and emitter for Python
 python-m2crypto      a crypto and SSL toolkit for Python
 python-sqlite        Python interface to SQLite 2
 osc                  OpenSUSE (buildsystem) commander
 python-rpm           Python bindings for RPM
 python-iniparse      Module to access and modify configuration data in INI fil
 python-urlgrabber    A high-level cross-protocol url-grabber

Я решил проблему следующим образом:

$ sudo apt-get download python-minimal
$ sudo dpkg -i python-minimal_2.7.5-5ubuntu1_amd64.deb
$ sudo apt-get -f install
Setting up python-m2crypto (0.20.1+dfsg1-1.1ubuntu1) ...
Setting up python-sqlite (1.0.1-8) ...
Setting up python-urlgrabber (3.9.1-4ubuntu1) ...
Setting up python-yaml (3.10-1) ...
Setting up python-rpm (4.9.0-7ubuntu0.1) ...
Setting up osc (0.132.4-1) ...
Setting up python-iniparse (0.4-2.1) ...
$ sudo dpkg --audit output blank

Решено !

0
ответ дан 10 May 2014 в 19:51

Другие вопросы по тегам:

Похожие вопросы: