Не может выполнить, удалить или переустановить инструмент тонкой настройки гнома

Когда я пытаюсь работать:

$ gnome-tweak-tool 
Traceback (most recent call last):
  File "/usr/bin/gnome-tweak-tool", line 26, in <module>
    import gtweak
ImportError: No module named 'gtweak'

Затем, когда я пытаюсь удалить, я добираюсь:

$ sudo apt-get remove --purge gnome-tweak-tool
The following packages will be REMOVED:
  gnome-tweak-tool*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 1,005 kB disk space will be freed.
Do you want to continue? [Y/n] Y
dpkg: error processing package gnome-tweak-tool (--remove):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
Errors were encountered while processing:
 gnome-tweak-tool
E: Sub-process /usr/bin/dpkg returned an error code (1)

И когда я пытаюсь переустановить

$ sudo apt-get install gnome-tweak-tool
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gnome-tweak-tool is already the newest version (3.20.1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/170 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
dpkg: error processing package gnome-tweak-tool (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Errors were encountered while processing:
 gnome-tweak-tool
E: Sub-process /usr/bin/dpkg returned an error code (1)

Так как я хотел установить и выполнить другие пакеты, я сделал это:

$ sudo gedit /var/lib/dpkg/status

Расположенный пакет тонкой настройки гнома, и удаленный целый блок информации об этом и сохранил файл.

Я внес некоторые изменения в Python рано для установки некоторого программного обеспечения. Я думаю, что сделал python3 значение по умолчанию, но я не помню точно. Я не изучал инструмент тонкой настройки в течение некоторого времени. Теперь я нуждаюсь в помощи для получения его работа.Что мне делать?

Результат переустанавливает

sudo apt-get install --reinstall gnome-tweak-tool
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  gnome-tweak-tool
0 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
15 not fully installed or removed.
Need to get 0 B/170 kB of archives.
After this operation, 1,005 kB of additional disk space will be used.
Selecting previously unselected package gnome-tweak-tool.
(Reading database ... 512559 files and directories currently installed.)
Preparing to unpack .../gnome-tweak-tool_3.20.1-1_all.deb ...
Unpacking gnome-tweak-tool (3.20.1-1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Processing triggers for desktop-file-utils (0.23-1ubuntu1.1) ...
Setting up linux-libc-dev:amd64 (4.8.0-46.49) ...
Setting up linux-libc-dev:i386 (4.8.0-46.49) ...
Setting up gnome-tweak-tool (3.20.1-1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, 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 package gnome-tweak-tool (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for bamfdaemon (0.5.3+16.10.20160929-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for libc-bin (2.24-3ubuntu2) ...
Setting up linux-tools-common (4.8.0-46.49) ...
Processing triggers for systemd (231-9ubuntu3) ...
Setting up lightdm (1.19.5-0ubuntu1.1) ...
Setting up liblightdm-gobject-1-0:amd64 (1.19.5-0ubuntu1.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu4) ...
Processing triggers for dbus (1.10.10-1ubuntu1.1) ...
Processing triggers for hicolor-icon-theme (0.15-1) ...
Setting up linux-image-4.8.0-46-generic (4.8.0-46.49) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-46-generic
W: plymouth module (/usr/lib/x86_64-linux-gnu/plymouth//.so) missing, skipping that theme.
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.8.0-46-generic
Found initrd image: /boot/initrd.img-4.8.0-46-generic
Found linux image: /boot/vmlinuz-4.8.0-45-generic
Found initrd image: /boot/initrd.img-4.8.0-45-generic
Found linux image: /boot/vmlinuz-4.8.0-44-generic
Found initrd image: /boot/initrd.img-4.8.0-44-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
Setting up linux-headers-4.8.0-46 (4.8.0-46.49) ...
Setting up linux-tools-4.8.0-46 (4.8.0-46.49) ...
Setting up linux-tools-4.8.0-46-generic (4.8.0-46.49) ...
Setting up linux-headers-4.8.0-46-generic (4.8.0-46.49) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
Setting up linux-image-extra-4.8.0-46-generic (4.8.0-46.49) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-46-generic
W: plymouth module (/usr/lib/x86_64-linux-gnu/plymouth//.so) missing, skipping that theme.
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.8.0-46-generic /boot/vmlinuz-4.8.0-46-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.8.0-46-generic
Found initrd image: /boot/initrd.img-4.8.0-46-generic
Found linux image: /boot/vmlinuz-4.8.0-45-generic
Found initrd image: /boot/initrd.img-4.8.0-45-generic
Found linux image: /boot/vmlinuz-4.8.0-44-generic
Found initrd image: /boot/initrd.img-4.8.0-44-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
Setting up linux-image-generic (4.8.0.46.58) ...
Setting up linux-tools-virtual (4.8.0.46.58) ...
Setting up linux-headers-generic (4.8.0.46.58) ...
Setting up linux-generic (4.8.0.46.58) ...
Processing triggers for libc-bin (2.24-3ubuntu2) ...
Errors were encountered while processing:
 gnome-tweak-tool
E: Sub-process /usr/bin/dpkg returned an error code (1)
athul@black-box:~$ gnome-tweak-tool 
Traceback (most recent call last):
  File "/usr/bin/gnome-tweak-tool", line 26, in <module>
    import gtweak
ImportError: No module named 'gtweak'

Вывод Python

athul@black-box:~$ python --version
Python 3.5.2+
athul@black-box:~$ readlink -f "$(which python)"
/usr/bin/python3.5
athul@black-box:~$ which python
/usr/bin/python
athul@black-box:~$ readlink "$(which python)"
/usr/bin/python3
2
задан 7 April 2017 в 15:00

1 ответ

Первая часть (по умолчанию устанавливающая Python 3) статьи « Как настроить сервер Apache, MySQL и Python (LAMP) без фреймворка в Ubuntu 14.04 » - это лишние и вредные блокировки, потому что /usr/bin/python ссылается на Python 2.7, потому что именно этого требует сам Python для стандартизированной среды выполнения.

Вы можете отменить этот шаг с помощью одного из двух:

  • Вернуть символическую ссылку к своей предыдущей цели:

    sudo ln -sf python2 /usr/bin/python
    
  • Переустановите пакет python-minimal:

    sudo apt-get install -f --reinstall python-minimal
    

Кроме того, вы можете отредактировать первую строку скрипта Python шага 5, чтобы прочитать

#!/usr/bin/python3

и установка Python-on-Apache должна все еще работать как прежде.

1
ответ дан 2 December 2019 в 04:49

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

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