我运行了“sudo apt-get install python-setuptools python-pip”,但收到了:
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-pip : Depends: python-pip-whl (= 1.5.4-1ubuntu3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我通常只运行 sudo apt-get install python-pip 并且它有效,我不知道为什么我决定尝试 setuptools。我尝试使用 Synaptic 包管理器,单击菜单栏中的“编辑”,然后单击“修复损坏的包”和命令行sudo dpkg --configure -a
,sudo apt-get -f install
但我仍然无法安装 python-pip。
我使用的是 linux mint 17 xfce 3.13.0-37-generic,使用 Python 2.7.6。
任何帮助是极大的赞赏。我在网上看到了很多关于 dpkg 的命令,但我对软件包不够熟悉,我不想破坏其他任何东西。
更新:
“sudo apt-cache 策略 python-pip”
python-pip:
Installed: (none)
Candidate: 1.5.4-1ubuntu3
Version table:
1.5.4-1ubuntu3 0
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
1.5.4-1 0
500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
“sudo apt-get install python-pip-whl”
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-pip-whl : Depends: python-requests-whl but it is not installable
Depends: python-setuptools-whl but it is not installable
Depends: python-six-whl but it is not installable
Depends: python-urllib3-whl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
更新#2
$ sudo apt-cache 策略 python-pip-whl python-requests-whl python-setuptools-whl python-6-whl python-urllib3-whl
python-pip-whl:
Installed: (none)
Candidate: 1.5.4-1ubuntu1
Version table:
1.5.4-1ubuntu1 0
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
python-requests-whl:
Installed: (none)
Candidate: (none)
Version table:
python-setuptools-whl:
Installed: (none)
Candidate: (none)
Version table:
python-six-whl:
Installed: (none)
Candidate: (none)
Version table:
python-urllib3-whl:
Installed: (none)
Candidate: 1.7.1-1ubuntu3
Version table:
1.7.1-1ubuntu3 0
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
$ 用于 python-requests-whl 中的 pkg python-setuptools-whl python-6-whl python-urllib3-whl;执行 sudo apt-get install $pkg;完毕
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-requests-whl is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-requests-whl' has no installation candidate
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-setuptools-whl is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-setuptools-whl' has no installation candidate
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-six-whl is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-six-whl' has no installation candidate
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-urllib3-whl : Depends: python-six-whl but it is not installable
E: Unable to correct problems, you have held broken packages.
更新#3
$ /etc/apt/sources.list
#deb cdrom:[Linux Mint 17.1 _Rebecca_ - Release amd64 20150107]/ trusty contrib main non-free
更新#4
$ /etc/apt/sources.list.d $ ll
total 16
drwxr-xr-x 2 root root 4096 Jun 21 01:00 .
drwxr-xr-x 6 root root 4096 Jun 24 00:52 ..
-rw-r--r-- 1 root root 59 Jan 7 12:29 getdeb.list
-rw-r--r-- 1 root root 530 Jan 7 12:29 official-package-repositories.list
$ cat getdeb.list
# deb http://archive.getdeb.net/ubuntu trusty-getdeb apps
$ cat 官方包存储库.list
# Do not edit this file manually, use Software Sources instead.
deb http://packages.linuxmint.com rebecca main upstream import #id:linuxmint_main
deb http://extra.linuxmint.com rebecca main #id:linuxmint_extra
deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ trusty partner
更新#5
/etc/apt/apt.conf.d $ ll
total 52
drwxr-xr-x 2 root root 4096 Jun 24 01:06 .
drwxr-xr-x 6 root root 4096 Jun 24 00:52 ..
-rw-r--r-- 1 root root 49 Jun 21 00:59 00aptitude
-rw-r--r-- 1 root root 41 Jan 7 11:58 00cdrom
-rw-r--r-- 1 root root 73 Jan 7 11:58 00recommends
-rw-r--r-- 1 root root 40 Jun 21 00:58 00trustcdrom
-rw-r--r-- 1 root root 643 Apr 10 2014 01autoremove
-rw-r--r-- 1 root root 992 Jan 7 12:23 01autoremove-kernels
-rw-r--r-- 1 root root 123 Apr 10 2014 20changelog
-rw-r--r-- 1 root root 243 Mar 11 2013 20dbus
-rw-r--r-- 1 root root 2331 Apr 2 2014 50unattended-upgrades
-rw-r--r-- 1 root root 182 Feb 23 2014 70debconf
-rw-r--r-- 1 root root 33 Jun 24 01:06 99synaptic
/etc/apt/preferences.d $ ll
total 16
drwxr-xr-x 2 root root 4096 Jun 21 01:16 .
drwxr-xr-x 6 root root 4096 Jun 24 00:52 ..
-rw-r--r-- 1 root root 216 Feb 3 07:15 official-extra-repositories.pref
-rw-r--r-- 1 root root 171 Jan 7 12:29 official-package-repositories.pref
答案1
我遇到过同样的问题;您可以通过先更新来修复它:
# apt-get update