我正在尝试使用 apt-get 和包管理器更新我的系统。当我运行更新时,我收到有关 mysql 依赖项的错误。由于我不关心 mysql,我尝试“清除”它 - 这是我得到的结果:
sudo apt-get remove --purge mysql-server-5.5
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
mysql-server : Depends: mysql-server-5.5 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
当我执行 sudo apt-get -f install 时,它会给出以下类似的结果:
sudo apt-get -f 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:
liblash3 libcommons-jxpath-java libmaven-dependency-tree-java
libjaxp1.3-java junit4 libgnustep-base1.20 libplexus-archiver-java
libmaven-filtering-java librhino-java extra-xdg-menus
libplexus-containers-java libmaven-compiler-plugin-java libwagon-java
libappframework-java libmodello-java libgeronimo-jms-1.1-spec-java libunity4
libdb4.7-java libunity6 libmaven-resources-plugin-java
libplexus-compiler-javac-java libplexus-classworlds-java libmaven2-core-java
libx264-116 libfile-homedir-perl libhttpclient-java libservlet2.4-java antlr
libcommons-beanutils-java libxom-java libxalan2-java libcommons-jexl-java
zeitgeist-extension-fts libecal1.2-8 g++-4.5 junit libplexus-cipher-java
libtextcat-data libdom4j-java libxpp2-java libasm2-java default-jdk-doc
libdee-1.0-1 libplexus-component-api-java libplexus-build-api-java
libplexus-i18n-java libutouch-geis1 libplexus-interactivity-api-java
libqdox-java libncurses5-dev libstdc++6-4.5-dev libnspr4-0d:i386 libsqlite0
libswingx-java libcommons-cli-java java-wrappers libjaxen-java
libunity-misc0 libindicator3-6 gir1.2-vte-0.0 gir1.2-appindicator-0.1
libxbean-java libcommons-net2-java libgadu3 libswingworker-java
libmaven-clean-plugin-java libsaxon-java libfolks22 jruby1.1 lib32ffi6
libitext1-java libdb5.1-java libcommons-collections-java libgegl-0.0-0
libindicator3 libindicator6 libplexus-ant-factory-java
libplexus-container-default-java default-jdk libjsch-java libtinfo-dev bsh
libplexus-compiler-manager-java libgdata11 libeasymock-java
libplexus-compiler-api-java fop libedata-cal1.2-10 libjaxme-java
libedata-book1.2-8 libfm-gtk0 libbsf-java libgwibber1 libnekohtml-java
libplexus-io-java libplexus-bsh-factory-java libclassworlds-java
libedataserverui1.2-11 eagle-data libplexus-interpolation-java
libgoogle-collections-java libplexus-digest-java gcj-4.5-base
libgdata1.7-cil libminiupnpc5 libpoppler-glib6 libantlr-java libjdom1-java
libhttpcore-java libmaven-file-management-java libtextcat0 libfm0
libservlet2.3-java libmaven-jar-plugin-java libcommons-vfs-java libxpp3-java
libjsr305-java libjsoup-java libjpeg62:i386 libquvi0 libregexp-java
lib32ncursesw5 libfop-java libplexus-compiler-java
libcommons-configuration-java rhino libnl3 libgtkspell3-0
libboost-serialization1.42.0 libcamel1.2-19 libxmlgraphics-commons-java
libwerken.xpath-java gir1.2-dee-0.5 libavahi-compat-libdnssd1
libhamcrest-java libmaven-archiver-java libnetbeans-cvsclient-java
libequinox-osgi-java libobjc2 libcommons-collections3-java
libplexus-utils-java libplexus-sec-dispatcher-java libmaven-scm-java
libdoxia-java libfolks-telepathy22 libcommons-digester-java libbatik-java
libbackport-util-concurrent-java libmaven-install-plugin-java
libmaven-shared-io-java libnatpmp1 python-wsgi-intercept libjline-java
libcommons-io-java libpoppler13 libnss3-1d:i386 icc-profiles-free
liboverlay-scrollbar-0.1-0 libebook1.2-10 libllvm2.9 libllvm2.9:i386
libganymed-ssh2-java
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
mysql-server mysql-server-5.5
Suggested packages:
tinyca
The following packages will be upgraded:
mysql-server mysql-server-5.5
2 upgraded, 0 newly installed, 0 to remove and 191 not upgraded.
2 not fully installed or removed.
Need to get 0 B/8,867 kB of archives.
After this operation, 57.3 kB of additional disk space will be used.
Do you want to continue [Y/n]?
dpkg: dependency problems prevent configuration of mysql-server-5.5:
mysql-server-5.5 depends on mysql-server-core-5.5 (= 5.5.29-0ubuntu0.12.04.2); however:
Version of mysql-server-core-5.5 on system is 5.5.31-0ubuntu0.12.04.2.
dpkg: error processing mysql-server-5.5 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not configured yet.
dpkg: error processing mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
Errors were encountered while processing:
mysql-server-5.5
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
-- 此时我不知所措……我无法删除有问题的软件包,尝试配置它们似乎会抛出错误,尝试完成它们的安装似乎也会抛出错误。而且 apt-get 和软件包管理器应用程序不会执行任何操作 - 不会安装任何更新,即使是安全相关的更新,也不会先抛出此错误。我该如何解决这个问题?
答案1
尝试这个:
sudo apt-get update
sudo apt-get purge mysql-server mysql-server-5.5