无法安装 python-apt

che*_*sus 6 package-management python apt

当我使用 pip 时会发生这种情况:

user1@ubuntu-ipc:~$ pip install python-apt
Collecting python-apt
  Using cached https://files.pythonhosted.org/packages/e5/ff/63bb64a103eda6f13364381e983c0121eeacc337a4421d6005ff7dd76741/python-apt-0.7.8.tar.bz2
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-OEhz4q/python-apt/setup.py", line 6, in <module>
        from DistUtilsExtra.command import *
    ImportError: No module named DistUtilsExtra.command

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-OEhz4q/python-apt/
Run Code Online (Sandbox Code Playgroud)

当我使用 apt 时会发生这种情况:

user1@ubuntu-ipc:~$ sudo apt-get install python-apt
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-apt : Depends: libapt-inst2.0 (>= 1.6.5~) but it is not going to be installed
              Depends: libapt-pkg5.0 (>= 1.6.5~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)

libapt-inst2.0取决于libapt-pkg5.0,取决于base-filesbase-passwdbashdebianutilsdiffutilse2fsprogshostnamelibapt-pkg5.0libc-binncurses-bin,它们都安装在其最新版本上。

user1@ubuntu-ipc:~$ sudo apt-get -f install
Run Code Online (Sandbox Code Playgroud)

结果是

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Run Code Online (Sandbox Code Playgroud)

关于如何进行有什么建议吗?

rub*_*o77 0

安装aptitude并尝试用它来安装它:

aptitude install python-apt
Run Code Online (Sandbox Code Playgroud)

这将为您提供更多解决冲突的选择