dpkg:处理包 unity-tweak-tool 时出错(--configure)

dpkg:处理包 unity-tweak-tool 时出错(--configure)

当我运行 apt-get install、apt-get upgrade、apt-get -f install 时,它总是返回以下内容:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
1 not fully installed or removed.
Need to get 0 B/333 kB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: error processing package unity-tweak-tool (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Errors were encountered while processing:
 unity-tweak-tool

怎么了?我尝试了所有命令,例如 apt-get remove、purge、clean,但都不起作用,仍然返回错误。

[编辑] 我尝试重新安装 unity tweak 工具,但它返回:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 4 not upgraded.
1 not fully installed or removed.
Need to get 0 B/333 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 216695 files and directories currently installed.)
Preparing to unpack .../unity-tweak-tool_0.0.6ubuntu1_all.deb ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted (core dumped)
dpkg: warning: subprocess old pre-removal script returned error exit status 134
dpkg: trying script from the new package instead ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted (core dumped)
dpkg: error processing archive /var/cache/apt/archives/unity-tweak-tool_0.0.6ubuntu1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 134
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted (core dumped)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 134
Errors were encountered while processing:
 /var/cache/apt/archives/unity-tweak-tool_0.0.6ubuntu1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

跑步

sudo apt-get install --reinstall unity-tweak-tool

按照错误消息的建议。您可能手动删除了一些文件并破坏了包。

答案2

你可以尝试这个:

sudo apt-get purge unity-tweak-tool
sudo -i
sudo apt-get update --fix-missing
sudo apt-get upgrade

这样也许能很好地发挥作用。

相关内容