我正在将Ubuntu 16.04升级到17.04,当时某些打包无法升级。这使得apt依赖于破碎状态。我在网上尝试了其他一些答案,但我担心这只会使情况复杂化。根据一个特定的答案,我意识到解决这些问题的最简单方法是从ubuntu archive手动安装软件包。我只想知道我应该执行的升级/安装,以解决问题。
各种命令的输出: -
安装: -
$sudo apt install yum-utils
Reading package lists... Done
Building dependency tree... 50%
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python : PreDepends: python-minimal (= 2.7.11-2) but 2.7.14-2ubuntu1 is to be installed
Depends: libpython-stdlib (= 2.7.11-2) but 2.7.14-2ubuntu1 is to be installed
python-all : Depends: python (= 2.7.14-2ubuntu1) but 2.7.11-2 is to be installed
python-all-dev : Depends: python (= 2.7.14-2ubuntu1) but 2.7.11-2 is to be installed
python-dev : Depends: python (= 2.7.14-2ubuntu1) but 2.7.11-2 is to be installed
resetter : Depends: python-qt4 (>= 4.10) but it is not going to be installed
Depends: python-mechanize (>= 1:0.2.5) but it is not going to be installed
yum-utils : Depends: python-iniparse but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
升级: -
$sudo apt upgrade gnome-control-center
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
python : PreDepends: python-minimal (= 2.7.11-2) but 2.7.14-2ubuntu1 is installed
Depends: libpython-stdlib (= 2.7.11-2) but 2.7.14-2ubuntu1 is installed
python-all : Depends: python (= 2.7.14-2ubuntu1) but 2.7.11-2 is installed
python-all-dev : Depends: python (= 2.7.14-2ubuntu1) but 2.7.11-2 is installed
python-dev : Depends: python (= 2.7.14-2ubuntu1) but 2.7.11-2 is installed
resetter : Depends: python-qt4 (>= 4.10) but it is not installed
Depends: python-mechanize (>= 1:0.2.5) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
修复损坏的安装: -
$sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
account-plugin-facebook account-plugin-flickr account-plugin-google account-plugin-tools
accountsservice-ubuntu-schemas accountsservice-ubuntu-touch-schemas address-book-service
app-install-data apparmor-easyprof-ubuntu biometryd-bin cgmanager click click-apparmor
content-hub espeak-data evolution-data-server-online-accounts evolution-data-server-utouch
folks-common fonts-font-awesome gcc-6-base:i386 gir1.2-appstreamglib-1.0 gir1.2-click-0.4
gir1.2-gee-0.8 gir1.2-gusb-1.0 gir1.2-mutter-0 gksu glassfish-javaee gnome-backgrounds
gnome-contacts googletest history-service hwdata i965-va-driver:i386 icoutils indicator-network
indicator-transfer indicator-transfer-download-manager ipython-notebook-common kate-data
kde-baseapps-data kde-runtime-data kde-style-breeze kdelibs5-data libaacs0:i386
libaccount-plugin-1.0-0 libaccount-plugin-facebook libaccount-plugin-flickr
libaccount-plugin-generic-oauth libaccount-plugin-google libaccounts-qt5-1
libandroid-properties1 libass5 libattica0.4 libattica0.4:i386 libaudio2:i386
libavahi-client3:i386 libavahi-common-data:i386 libavahi-common3:i386 libavcodec57:i386
libavformat57:i386 libavutil55:i386 libbdplus0:i386 libbiometryd1 libblas-common libbluray1
libbluray1:i386 libbluray2:i386 libboost-atomic-dev libboost-atomic1.61.0
libboost-atomic1.62-dev libboost-atomic1.62.0 libboost-chrono-dev libboost-chrono1.61.0
libboost-chrono1.62-dev libboost-chrono1.62.0 libboost-context-dev libboost-context1.61.0
libboost-context1.62-dev libboost-context1.62.0 libboost-coroutine-dev libboost-coroutine1.61.0
libboost-coroutine1.62-dev libboost-coroutine1.62.0 libboost-date-time-dev
libboost-date-time1.61.0 libboost-date-time1.62-dev libboost-dev libboost-exception-dev
libboost-exception1.62-dev libboost-fiber-dev libboost-fiber1.62-dev libboost-fiber1.62.0
libboost-filesystem-dev libboost-filesystem1.61.0 libboost-filesystem1.62-dev libboost-graph-dev
libboost-graph-parallel-dev libboost-graph-parallel1.61.0 libboost-graph-parallel1.62-dev
libboost-graph-parallel1.62.0 libboost-graph1.61.0 libboost-graph1.62-dev libboost-graph1.62.0
libboost-iostreams-dev libboost-iostreams1.61.0 libboost-iostreams1.62-dev libboost-locale-dev
libboost-locale1.61.0 libboost-locale1.62-dev libboost-locale1.62.0 libboost-log-dev
libboost-log1.61.0 libboost-log1.62-dev libboost-log1.62.0 libboost-math-dev libboost-math1.61.0
libboost-math1.62-dev libboost-math1.62.0 libboost-mpi-dev libboost-mpi1.61.0
libboost-mpi1.62-dev libboost-mpi1.62.0 libboost-program-options-dev
libboost-program-options1.61.0 libboost-program-options1.62-dev libboost-program-options1.62.0
libboost-python-dev libboost-python1.61.0 libboost-python1.62-dev libboost-python1.62.0
libboost-random-dev libboost-random1.61.0 libboost-random1.62-dev libboost-regex-dev
libboost-regex1.61.0 libboost-regex1.62-dev libboost-serialization-dev
libboost-serialization1.61.0 libboost-serialization1.62-dev libboost-signals-dev
libboost-signals1.61.0 libboost-signals1.62-dev libboost-signals1.62.0 libboost-system-dev
libboost-system1.61.0 libboost-system1.62-dev libboost-test-dev libboost-test1.61.0
libboost-test1.62-dev libboost-test1.62.0 libboost-thread-dev libboost-thread1.61.0
libboost-thread1.62-dev libboost-timer-dev libboost-timer1.61.0 libboost-timer1.62-dev
libboost-timer1.62.0 libboost-tools-dev libboost-type-erasure-dev libboost-type-erasure1.62-dev
libboost-type-erasure1.62.0 libboost-wave-dev libboost-wave1.61.0 libboost-wave1.62-dev
libboost-wave1.62.0 libboost1.62-dev libboost1.62-tools-dev libbsh-java libcairo2:i386
libcamel-1.2-59 libchamplain-0.12-0 libchromaprint0 libchromaprint0:i386 libchromaprint1:i386
libclassworlds-java libclick-0.4-0 libclucene-core1v5:i386 libcommons-compress-java
libcommons-httpclient-java libcommons-lang-java libconnectivity-qt1 libcontent-hub-glib0
libcontent-hub0 libcrystalhd3:i386 libcups2:i386 libdbus-1-3:i386 libdbus-cpp5
libdbusmenu-qt2:i386 libdirectfb-1.2-9 libdlrestrictions1:i386 libdom4j-java libdoxia-core-java
libeasymock-java libebook-1.2-16 libebur128-1 libeclipse-aether-java libertine-xmir-tools
libertined libespeak1 libevent-core-2.0-5 libexiv2-14:i386 libfabric1 libfolks-eds25
libfolks-telepathy25 libfolks25 libfontconfig1:i386 libfreetype6:i386
libgeronimo-ejb-3.0-spec-java libgeronimo-jms-1.1-spec-java libgeronimo-osgi-support-java
libgeronimo-validation-1.0-spec-java libgflags2.2 libgflags2v5 libgksu2-0 libglib2.0-0:i386
libgme0:i386 libgmime-2.6-0 libgmp10:i386 libgnutls30:i386 libgomp1:i386 libgoogle-glog0v5
libgsm1:i386 libgssapi-krb5-2:i386 libgtkspell3-3-0 libgtop-2.0-10 libhardware2 libhdf5-10
libhdf5-cpp-11 libhistoryservice0 libhogweed4:i386 libhud2 libhunspell-1.4-0 libhwloc-dev
libhwloc-plugins libhwloc5 libhybris libhybris-common1 libibverbs-dev libice6:i386 libicu57:i386
libidn11:i386 libindicator-transfer0 libjasper1 libjaxen-java libjbig0:i386 libjdom1-java
libjdom2-java libjetty8-java libjetty9-java libjpeg-turbo8:i386 libjpeg8:i386 libjs-highlight
libjs-highlight.js libjs-jquery-ui libjs-marked libjs-sphinxdoc libk5crypto3:i386
libkdecore5:i386 libkdeui5:i386 libkeyutils1:i386 libkf5gpgmepp5 libkf5style5 libkio5:i386
libkonq5-templates libkparts4:i386 libkprintutils4:i386 libkrb5-3:i386 libkrb5support0:i386
liblcms2-2:i386 libleveldb1v5 liblibertine1 liblightdm-qt5-3-0 liblircclient0 liblivemedia52
liblivemedia57 libllvm3.8 libllvm3.8:i386 libllvm4.0 libllvm4.0:i386 liblouis10
libmaven-archiver-java libmaven2-core-java libmecab2 libmedia1 libmediascanner-2.0-4 libmiral2
libmircommon6 libmirplatform13 libmirplatform15 libmirplatform16 libmirserver41 libmirserver43
libmirserver45 libmission-control-plugins0 libmng2:i386 libmodplug1 libmodplug1:i386
libmozjs-24-0v5 libmozjs-38-0 libmp3lame0:i386 libmpg123-0:i386 libmutter-0-0
libmysqlclient20:i386 libnettle6:i386 libnm-glib-vpn1 libntrack-qt4-1 libntrack0 libnuma-dev
libnuma1:i386 libobjenesis-java libogg0:i386 libonline-accounts-client1
libonline-accounts-daemon1 libonline-accounts-qt1 libopencv-core2.4v5 libopencv-imgproc2.4v5
libopenjp2-7:i386 libopenjpeg5 libopenjpeg5:i386 libopenmpi-dev libopenmpi2 libopenmpt0:i386
libopus0:i386 liborc-0.4-0:i386 liborcus-0.11-0 libosgi-annotation-java libosgi-compendium-java
libosgi-core-java liboxideqt-qmlplugin liboxideqtcore0 liboxideqtquick0 libp11-kit0:i386
libpam-cgfs libpanel-applet0 libpanel-applet2 libpay2 libperl5.22 libperl5.24 libphonon4
libpixman-1-0:i386 libplexus-ant-factory-java libplexus-archiver-java libplexus-bsh-factory-java
libplexus-cli-java libplexus-component-metadata-java libplexus-container-default-java
libplexus-container-default1.5-java libplexus-containers-java libplexus-containers1.5-java
libplexus-interactivity-api-java libplexus-io-java libpng16-16:i386 libpolkit-qt-1-1
libpoppler61 libpoppler64 libpsm-infinipath1 libpython3.5 libpython3.5-dev libqca2
libqca2-plugins libqdjango-db0 libqdox-java libqdox2-java libqgsttools-p1 libqimageblitz4:i386
libqmenumodel0 libqofono-qt5-0 libqpdf17 libqt4-dbus:i386 libqt4-declarative:i386
libqt4-network:i386 libqt4-qt3support libqt4-script:i386 libqt4-sql:i386 libqt4-sql-mysql:i386
libqt4-svg:i386 libqt4-xml:i386 libqt4-xmlpatterns:i386 libqt5clucene5 libqt5concurrent5
libqt5contacts5 libqt5feedback5 libqt5multimedia5-plugins libqt5multimediaquick-p5
libqt5multimediawidgets5 libqt5organizer5 libqt5positioning5 libqt5quicktest5 libqt5sensors5
libqt5systeminfo5 libqt5versit5 libqt5xmlpatterns5 libqtcore4:i386 libqtdbus4:i386
libqtgui4:i386 libraw15 librdmacm1 librtmp1:i386 libschroedinger-1.0-0
libschroedinger-1.0-0:i386 libservlet3.0-java libshine3:i386 libsignon-extension1
libsignon-plugins-common1 libsignon-qt5-1 libsm6:i386 libsnappy-java libsnappy-jni
libsnappy1v5:i386 libsolid4:i386 libsoxr0:i386 libspeex1:i386 libspring-aop-java
libspring-beans-java libspring-context-java libspring-core-java libspring-expression-java
libspring-instrument-java libssh-gcrypt-4:i386 libstreamanalyzer0v5:i386 libstreams0v5:i386
libswresample2:i386 libsystemsettings1 libtasn1-6:i386 libtelepathy-qt4-2 libtelepathy-qt5-0
libtheora0:i386 libthreadweaver4 libthumbnailer-qt1.0 libtiff5:i386 libtracker-sparql-1.0-0
libtrust-store2 libtwolame0:i386 libubuntu-app-launch3 libubuntu-application-api3
libubuntu-download-manager-client1 libubuntu-download-manager-common1
libubuntu-location-service3 libubuntu-platform-hardware-api3 libubuntumetrics5
libubuntuoneauth-2.0-0 libudm-common1 libudm-priv-common1 libunity-action-qt1 liburcu4
libusermetricsinput1 libusermetricsoutput1 libva-drm1:i386 libva-x11-1:i386 libva1:i386
libvdpau1:i386 libvorbis0a:i386 libvorbisenc2:i386 libvorbisfile3:i386 libvpx3 libvpx3:i386
libvpx4:i386 libwagon-java libwavpack1:i386 libwebp6:i386 libwebpmux2 libwebpmux2:i386
libwebpmux3:i386 libx264-148:i386 libx265-110 libx265-110:i386 libx265-130:i386 libx265-79
libx265-79:i386 libx86-1 libxapian22v5 libxbean-java libxbean-reflect-java libxcb-render0:i386
libxcb-shm0:i386 libxcb-xfixes0:i386 libxen-4.7 libxen-4.8 libxi6:i386 libxml2:i386 libxom-java
libxpp2-java libxpp3-java libxrender1:i386 libxt6:i386 libxvidcore4:i386 libxz-java
libzvbi0:i386 linux-headers-4.8.0-58 linux-headers-4.8.0-58-generic linux-image-4.8.0-58-generic
linux-image-extra-4.8.0-58-generic linux-signed-image-4.8.0-58-generic mediascanner2.0
mesa-va-drivers:i386 mesa-vdpau-drivers:i386 mir-client-platform-mesa5
mir-graphics-drivers-desktop mir-platform-graphics-mesa-kms12 mir-platform-graphics-mesa-kms13
mir-platform-graphics-mesa-x12 mir-platform-graphics-mesa-x13 mir-platform-input-evdev6
mir-platform-input-evdev7 mpi-default-bin mpi-default-dev musescore-soundfont-gm
network-manager-openvpn node-sigmund ntrack-module-libnl-0 openmpi-bin openmpi-common
oxideqt-codecs oxygen-icon-theme oxygen5-icon-theme perl-modules-5.22 perl-modules-5.24 phonon
phonon-backend-gstreamer phonon-backend-gstreamer-common php7.0-xml plainbox-provider-checkbox
plainbox-provider-resource-generic plainbox-secure-policy pm-utils policykit-unity8 pyotherside
python-backports-abc python-concurrent.futures python-jinja2 python-markupsafe
python-singledispatch python-tornado python-zmq python3-apparmor-click python3-checkbox-support
python3-click-package python3-guacamole python3-jinja2 python3-libertine python3-padme
python3-plainbox python3-psutil python3-pyasn1 python3-pyparsing python3-xlsxwriter
python3.5-dev qmenumodel-qml qml-module-biometryd qml-module-io-thp-pyotherside qml-module-ofono
qml-module-pamauthentication0.1 qml-module-qmltermwidget1.0 qml-module-qt-labs-folderlistmodel
qml-module-qt-labs-settings qml-module-qtfeedback qml-module-qtmultimedia
qml-module-qtqml-statemachine qml-module-qtquick-xmllistmodel qml-module-qtsysteminfo
qml-module-qttest qml-module-ubuntu-connectivity qml-module-ubuntu-onlineaccounts
qml-module-ubuntu-onlineaccounts-client qml-module-ubuntu-onlineaccounts2
qml-module-ubuntu-performancemetrics qml-module-ubuntu-thumbnailer0.1 qmlscene qt-at-spi:i386
qtcontact5-galera qtdeclarative5-accounts-plugin qtdeclarative5-dev-tools
qtdeclarative5-gsettings1.0 qtdeclarative5-qtquick2-plugin qtdeclarative5-test-plugin
qtdeclarative5-ubuntu-content1 qtdeclarative5-ubuntu-download-manager0.1
qtdeclarative5-ubuntu-telephony0.1 qtdeclarative5-unity-action-plugin
qtdeclarative5-unity-notifications-plugin qtubuntu-desktop rename repowerd repowerd-data
signon-keyring-extension signon-plugin-oauth2 signon-plugin-password signon-ui signon-ui-service
signon-ui-x11 signond sqlite3 suru-icon-theme telepathy-mission-control-5 telephony-service
thumbnailer-service tone-generator ubuntu-app-launch-tools ubuntu-application-api3-desktop
ubuntu-application-api3-test ubuntu-download-manager ubuntu-mobile-icons ubuntu-push-client
ubuntu-ui-toolkit-theme ubuntuone-client-data ubuntuone-credentials-common
unity-control-center-signon unity-plugin-scopes unity-scope-gdrive unity-scope-mediascanner2
unity-system-compositor usermetricsservice va-driver-all:i386 vbetool vdpau-driver-all:i386 xmir
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libqt4-help libqt4-scripttools libqt4-test libqtassistantclient4 python python-mechanize
python-qt4
Suggested packages:
python-doc python-qt4-dbg
The following NEW packages will be installed:
libqt4-help libqt4-scripttools libqt4-test libqtassistantclient4 python-mechanize python-qt4
The following packages will be upgraded:
python
1 upgraded, 6 newly installed, 0 to remove and 8 not upgraded.
10 not fully installed or removed.
Need to get 0 B/3,139 kB of archives.
After this operation, 16.9 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up python-minimal (2.7.14-2ubuntu1) ...
Traceback (most recent call last):
File "/usr/local/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/compileall.py", line 16, in <module>
import struct
File "/usr/local/lib/python2.7/struct.py", line 1, in <module>
from _struct import *
ImportError: No module named _struct
dpkg: error processing package python-minimal (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
python-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)
我已经尝试了其他几个答案,但如果你愿意,我可以添加其他命令的输出
答案 0 :(得分:0)
运行以下命令:
sudo apt install aptitude
sudo aptitude install yum-utils
sudo apt autoremove