依赖和 apt-get 的问题

依赖和 apt-get 的问题

我正在尝试通过以下方式修复一些依赖项(python)

sudo apt-get install build-essential linux-headers-generic

它要求我尝试命令

sudo apt-get -f install

我得到了以下内容,但我不知道如何处理它们:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
0 upgraded, 0 newly installed, 0 to remove and 454 not upgraded.
5 not fully installed or removed.
Need to get 0 B/71.8 kB of archives.
After this operation, 0 B of additional disk space will be used.
Setting up gconf2 (3.2.6-0ubuntu2) ...
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 563, in <module>
main()
File "/usr/lib/python2.7/site.py", line 545, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python2.7/site.py", line 237, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 578, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 524, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 408, in _init_posix
from _sysconfigdata import build_time_vars
File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd
dpkg: error processing package gconf2 (--configure):
subprocess installed post-installation script returned error exit        status 1
dpkg: error processing package libgksu2-0 (--configure):
package libgksu2-0 is not ready for configuration
cannot configure (current status `half-installed')
dpkg: dependency problems prevent configuration of gksu:
gksu depends on libgksu2-0 (>= 2.0.8); however:
Package libgksu2-0 is not installed.

dpkg: error processing package gksu (--configure):
dependency problems - leaving unconfigured
Setting up python-pyinotify (0.9.4-1build1) ...
No apport report written because the error message indicates its a       followup error from a previous failure.
                      Could not find platform dependent libraries     <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 563, in <module>
main()
File "/usr/lib/python2.7/site.py", line 545, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python2.7/site.py", line 237, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 578, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 524, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 408, in _init_posix
from _sysconfigdata import build_time_vars
File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd
dpkg: error processing package python-pyinotify (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                          dpkg:         dependency problems prevent configuration of grive-tools:
grive-tools depends on python-pyinotify; however:
Package python-pyinotify is not configured yet.
grive-tools depends on gksu; however:
Package gksu is not configured yet.

dpkg: error processing package grive-tools (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                          Errors were   encountered while processing:
gconf2
libgksu2-0
gksu
python-pyinotify
grive-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

当我执行命令时

lsb_release -a 我得到以下信息:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:    14.04
Codename:   trusty

uname -a

Linux abdulla-VGN-CS230J 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12   11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

apt-cache policy libgksu2-0

libgksu2-0:
Installed: 2.0.13~pre1-6ubuntu4
Candidate: 2.0.13~pre1-6ubuntu4
Version table:
*** 2.0.13~pre1-6ubuntu4 0
    500 http://bh.archive.ubuntu.com/ubuntu/ trusty/universe amd64    Packages
    100 /var/lib/dpkg/status

修复 Python 包并重试后,sudo apt-get -f install我收到以下错误

dpkg: error processing package libgksu2-0 (--configure):
 package libgksu2-0 is not ready for configuration
 cannot configure (current status `half-installed')
dpkg: dependency problems prevent configuration of gksu:
 gksu depends on libgksu2-0 (>= 2.0.8); however:
  Package libgksu2-0 is not installed.
dpkg: error processing package gksu (--configure):
 dependency problems - leaving unconfigured
Setting up python-pyinotify (0.9.4-1build1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of grive-tools:
 grive-tools depends on gksu; however:
  Package gksu is not configured yet.
dpkg: error processing package grive-tools (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Setting up python2.7-minimal (2.7.6-8ubuntu0.2) ...
Setting up libpython2.7-stdlib:amd64 (2.7.6-8ubuntu0.2) ...
Setting up python2.7 (2.7.6-8ubuntu0.2) ...
Setting up libpython2.7:amd64 (2.7.6-8ubuntu0.2) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Errors were encountered while processing:
 libgksu2-0
 gksu
 grive-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

运行sudo dpkg --configure -a得到以下输出:

dpkg: dependency problems prevent configuration of gksu: gksu depends on libgksu2-0 (>= 2.0.8); however: Package libgksu2-0 is not installed. dpkg: error processing package gksu (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of grive-tools: grive-tools depends on gksu; however: Package gksu is not configured yet. dpkg: error processing package grive-tools (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: gksu grive-tools

并且运行dpkg -l 'libgksu2-0'

Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-============-============-================================= rH libgksu2-0 2.0.13~pre1- amd64 library providing su and sudo fun

答案1

修复你的 Python 安装,缺少的模块_sysconfigdata_nd.py位于libpython2.7-minimal

apt-get download libpython2.7-minimal
sudo dpkg -i libpython2.7-minimal*

并安装(未)安装且配置了一半的东西

apt-get download libgksu2-0
sudo dpkg -i libgksu2-0*

最后

sudo dpkg --configure -a
sudo apt-get -f install

相关内容