我正在尝试安装一个软件,但是当我尝试运行 bash install-deps(按照自述文件)时,我得到:
➜ torch git:(master) bash install-deps;
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease
Get:5 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Hit:6 http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu xenial InRelease
Hit:7 http://repository.spotify.com stable InRelease
Hit:8 http://dl.google.com/linux/chrome/deb stable Release
Hit:9 http://ppa.launchpad.net/plt/racket/ubuntu xenial InRelease
Get:10 http://us.archive.ubuntu.com/ubuntu xenial-updates/main Sources [237 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [501 kB]
Get:13 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [491 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [450 kB]
Get:15 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [436 kB]
Fetched 2,422 kB in 1s (1,935 kB/s)
Reading package lists... Done
Updated successfully.
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-software-properties : Depends: python-apt (>= 0.6.20ubuntu16) but it is not going to be installed
Depends: python-pycurl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
问题是,当我尝试按照它的建议安装 python-apt 时:
➜ torch git:(master) 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: python:any (>= 2.7.5-5~)
E: Unable to correct problems, you have held broken packages.
我认为自己是 Linux 菜鸟,但 Python 是默认安装的,对吧?当我运行 whereis python 时,它显示:
➜ torch git:(master) whereis python
python: /usr/bin/python3.5m /usr/bin/python2.7 /usr/bin/python3.5 /usr/lib/python2.7 /usr/lib/python3.5 /etc/python /etc/python3.4 /etc/python2.7 /etc/python3.5 /usr/local/bin/python /usr/local/bin/python2.7 /usr/local/bin/python2.7-config /usr/local/lib/python2.7 /usr/local/lib/python3.5 /usr/include/python3.5m /usr/share/python
所以 python 肯定在我的计算机上,事实上我似乎安装了它的几个不同版本。有什么建议可以解决这个问题吗?“apt-get install -f”似乎也没有任何效果。
编辑:这是 Aaron Nelson 请求的 /var/lib/dpkg/status 的内容:
➜ torch git:(master) cat /var/lib/dpkg/status | grep python-apt
Package: python-apt-common
Source: python-apt
Replaces: python-apt (<< 0.7.98+nmu1)
Breaks: python-apt (<< 0.7.98+nmu1)
Enhances: python-apt, python3-apt
Replaces: python-aptdaemon-gtk (<= 0.41+bzr580-0ubuntu1)
Source: python-apt
Replaces: python-apt (<< 0.7.98+nmu1)
Depends: python3 (<< 3.6), python3 (>= 3.5~), libapt-inst2.0 (>= 1.1~exp9), libapt-pkg5.0 (>= 1.1~exp9), libc6 (>= 2.14), libgcc1 (>= 1:3.0), libstdc++6 (>= 5.2), python-apt-common
Suggests: python3-apt-dbg, python-apt-doc
Breaks: python-apt (<< 0.7.98+nmu1)
Depends: gksu, python-apt, python-dbus, python-xdg, python-lxml, python-aptdaemon, python-aptdaemon.gtk3widgets, policykit-1-gnome | policykit-1-qt, python-defer, python-compizconfig, gir1.2-vte-2.90, gir1.2-gtk-3.0, gir1.2-gconf-2.0, gir1.2-notify-0.7, gir1.2-webkit-3.0, gir1.2-soup-2.4, dconf-gsettings-backend | gsettings-backend, gconf2 (>= 2.28.1-2), python (>= 2.7), python (<< 2.8), python:any (>= 2.7.1-0ubuntu2)
Replaces: python-aptdaemon-gtk (<< 0.41+bzr582-0ubuntu1)
Conflicts: python-aptdaemon-gtk (<< 0.41+bzr582-0ubuntu1)
Suggests: aptitude | synaptic | wajig, dpkg-dev (>= 1.17.2), apt-doc, python-apt
Replaces: python-aptdaemon.pkcompat
Conflicts: packagekit, python-aptdaemon.pkcompat
Depends: python:any (>= 2.7), iso-codes, app-install-data (>= 0.4.0), aptdaemon (>= 0.40), software-center-aptdaemon-plugins, humanity-icon-theme, gir1.2-glib-2.0 (>= 1.31), gir1.2-gtk-3.0, gir1.2-gmenu-3.0 (>= 3.1.5), gir1.2-webkit2-4.0, gvfs-backends, python-gi (>= 3.4.0-1ubuntu0.1), python-gi-cairo, python-xapian, python-apt (>= 0.8.3ubuntu4), python-aptdaemon (>= 0.40), python-aptdaemon.gtk3widgets, python-dbus, python-defer, python-lxml, policykit-1, policykit-1-gnome | policykit-1-kde, python-xdg, ubuntu-sso-client, python-piston-mini-client (>= 0.1+bzr29), oneconf (>= 0.2.6), python-oneconf (>= 0.3) | oneconf (<< 0.3), python-debtagshw
Depends: python3:any (>= 3.3.2-2~), python3, python3-gi, gir1.2-glib-2.0, python-apt-common (>= 0.9), python3-dbus, python3-software-properties (= 0.96.20.5), ca-certificates
答案1
看起来问题出在包装损坏上。或者至少是部分损坏:
E: Unable to correct problems, you have held broken packages.
要修复该问题,请尝试以下操作:
$>sudo apt-get clean $>sudo apt-get update --fix-missing