MySql 安装不正确,现在我无法使用软件中心或删除 MySql

MySql 安装不正确,现在我无法使用软件中心或删除 MySql

当我打开软件中心时,出现错误提示

“无法安装新软件,因为当前安装的软件有问题。您想立即修复此问题吗?”

当我单击修复按钮时,出现一个弹出窗口,提示“包操作失败。软件包的安装或删除失败。”

细节:

 installArchives() failed: Preconfiguring packages ...
    Preconfiguring packages ...
Preconfiguring packages ...
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 625805 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.5_5.5.44-0ubuntu0.14.04.1_amd64.deb ...
Aborting downgrade from (at least) 5.6 to 5.5.
If are sure you want to downgrade to 5.5, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.5_5.5.44-0ubuntu0.14.04.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.5_5.5.44-0ubuntu0.14.04.1_amd64.deb
Error in function: 
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.5; however:
Package mysql-server-5.5 is not installed.

dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured

然后我尝试使用以下方法完全删除 MySql

sudo apt-get remove --purge mysql\*

我得到了这个

 Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'cvm-mysql' for regex 'mysql*'
Note, selecting 'libnss-mysql-bg' for regex 'mysql*'
Note, selecting 'mysql-utilities' for regex 'mysql*'
Note, selecting 'libmysqlclient10-dev' for regex 'mysql*'
Note, selecting 'libdbd-mysql-ruby1.9.1' for regex 'mysql*'
Note, selecting 'parser3-mysql' for regex 'mysql*'
Note, selecting 'pinba-engine-mysql-5.5' for regex 'mysql*'
Note, selecting 'tntdb-mysql4' for regex 'mysql*'
Note, selecting 'dpm-mysql' for regex 'mysql*'
Note, selecting 'mysql-workbench-data' for regex 'mysql*'
Note, selecting 'libdspam7-drv-mysql' for regex 'mysql*'
Note, selecting 'python2.4-mysqldb' for regex 'mysql*'
Note, selecting 'mysql-server-core-5.0' for regex 'mysql*'
Note, selecting 'mysql-server-core-5.1' for regex 'mysql*'
Note, selecting 'mysql-server-core-5.5' for regex 'mysql*'
Note, selecting 'mysql-server-core-5.6' for regex 'mysql*'
Note, selecting 'sbnc-mysql' for regex 'mysql*'
Note, selecting 'jabberd2-mysql' for regex 'mysql*'
Note, selecting 'mysql-server-5.0' for regex 'mysql*'
Note, selecting 'mysql-server-5.1' for regex 'mysql*'
Note, selecting 'mysql-server-5.5' for regex 'mysql*'
Note, selecting 'php4-mysql' for regex 'mysql*'
Note, selecting 'mysql-server-5.6' for regex 'mysql*'
Note, selecting 'lua5.1-dbi-mysql-dev' for regex 'mysql*'
Note, selecting 'aolserver4-nsmysql' for regex 'mysql*'
Note, selecting 'mysql-workbench-oss' for regex 'mysql*'
Note, selecting 'gambas3-gb-mysql' for regex 'mysql*'
Note, selecting 'haskell-hsql-mysql-doc' for regex 'mysql*'
Note, selecting 'courier-authlib-mysql' for regex 'mysql*'
Note, selecting 'lua5.1-sql-mysql' for regex 'mysql*'
Note, selecting 'libqt4-sql-mysql' for regex 'mysql*'
Note, selecting 'lua5.1-sql-mysql-dev' for regex 'mysql*'
Note, selecting 'libmysql-cil-dev' for regex 'mysql*'
Note, selecting 'libmysql++3' for regex 'mysql*'
Note, selecting 'akonadi-backend-mysql' for regex 'mysql*'
Note, selecting 'mysql-client-core-5.1' for regex 'mysql*'
Note, selecting 'mysql-client-core-5.5' for regex 'mysql*'
Note, selecting 'mysql-client-core-5.6' for regex 'mysql*'
Note, selecting 'pure-ftpd-mysql' for regex 'mysql*'
Note, selecting 'libcrypt-mysql-perl' for regex 'mysql*'
Note, selecting 'automysqlbackup' for regex 'mysql*'
Note, selecting 'owncloud-mysql' for regex 'mysql*'
Note, selecting 'python-mysql.connector' for regex 'mysql*'
Note, selecting 'mysqltcl' for regex 'mysql*'
Note, selecting 'bacula-sd-mysql-dbg' for regex 'mysql*'
Note, selecting 'libqt5sql5-mysql' for regex 'mysql*'
Note, selecting 'virtual-mysql-testsuite' for regex 'mysql*'
Note, selecting 'libpocomysql9-dbg' for regex 'mysql*'
Note, selecting 'yate-mysql' for regex 'mysql*'
Note, selecting 'lua-dbi-mysql-dbg' for regex 'mysql*'
Note, selecting 'dpsyco-mysql' for regex 'mysql*'
Note, selecting 'mysql-mmm-agent' for regex 'mysql*'
Note, selecting 'libmysql5.0-cil' for regex 'mysql*'
Note, selecting 'mysql-client' for regex 'mysql*'
Note, selecting 'falconpl-dbi-mysql' for regex 'mysql*'
Note, selecting 'php5-mysql' for regex 'mysql*'
Note, selecting 'mysqmail-dovecot-logger' for regex 'mysql*'
Note, selecting 'libkaya-mysql-dev' for regex 'mysql*'
Note, selecting 'postfix-cluebringer-mysql' for regex 'mysql*'
Note, selecting 'libwtdbomysql35' for regex 'mysql*'
Note, selecting 'gnash-ext-mysql' for regex 'mysql*'
Note, selecting 'gmysqlcc' for regex 'mysql*'
Note, selecting 'mysql-mmm-monitor' for regex 'mysql*'
Note, selecting 'dbf2mysql' for regex 'mysql*'
Note, selecting 'lua-dbi-mysql-dev' for regex 'mysql*'
Note, selecting 'ulogd2-mysql' for regex 'mysql*'
Note, selecting 'mysql-common-5.6' for regex 'mysql*'
Note, selecting 'voms-mysql-plugin-dbg' for regex 'mysql*'
Note, selecting 'asterisk-mysql' for regex 'mysql*'
Note, selecting 'postfix-mysql' for regex 'mysql*'
Note, selecting 'libdbd-mysql-ruby' for regex 'mysql*'
Note, selecting 'pike7.8-mysql' for regex 'mysql*'
Note, selecting 'oar-server-mysql' for regex 'mysql*'
Note, selecting 'virtual-mysql-client' for regex 'mysql*'
Note, selecting 'libmysql++-dev' for regex 'mysql*'
Note, selecting 'scilab-scimysql' for regex 'mysql*'
Note, selecting 'libmysql6.0-cil' for regex 'mysql*'
Note, selecting 'mysql-workbench-community' for regex 'mysql*'
Note, selecting 'lua5.2-sql-mysql-dev' for regex 'mysql*'
Note, selecting 'strongswan-plugin-mysql' for regex 'mysql*'
Note, selecting 'mysql-mmm-common' for regex 'mysql*'
Note, selecting 'root-plugin-io-mysql' for regex 'mysql*'
Note, selecting 'monodoc-mysql6.0-manual' for regex 'mysql*'
Note, selecting 'kamailio-mysql-modules' for regex 'mysql*'
Note, selecting 'lua-dbi-mysql' for regex 'mysql*'
Note, selecting 'tcl8.6-tdbc-mysql' for regex 'mysql*'
Note, selecting 'pdns-backend-mysql' for regex 'mysql*'
Note, selecting 'r-cran-rmysql' for regex 'mysql*'
Note, selecting 'kexi-mysql-driver' for regex 'mysql*'
Note, selecting 'libghc-hsql-mysql-dev' for regex 'mysql*'
Note, selecting 'bacula-sd-mysql' for regex 'mysql*'
Note, selecting 'libmysqlclient12-dev' for regex 'mysql*'
Note, selecting 'mysql-source-5.5' for regex 'mysql*'
Note, selecting 'mysql-source-5.6' for regex 'mysql*'
Note, selecting 'libghc-hsql-mysql-prof' for regex 'mysql*'
Note, selecting 'mha4mysql-master' for regex 'mysql*'
Note, selecting 'libghc-hsql-mysql-prof-1.8.2-e92cc' for regex 'mysql*'
Note, selecting 'libmysqlcppconn7' for regex 'mysql*'
Note, selecting 'ulogd-mysql' for regex 'mysql*'
Note, selecting 'mysql-mmm-tools' for regex 'mysql*'
Note, selecting 'dpm-copy-server-mysql' for regex 'mysql*'
Note, selecting 'php5-mysqli' for regex 'mysql*'
Note, selecting 'mysql-testsuite-5.5' for regex 'mysql*'
Note, selecting 'mysql-testsuite-5.6' for regex 'mysql*'
Note, selecting 'dpm-mysql-srmv22' for regex 'mysql*'
Note, selecting 'lua-sql-mysql' for regex 'mysql*'
Note, selecting 'python2.7-mysqldb' for regex 'mysql*'
Note, selecting 'libmysql-java' for regex 'mysql*'
Note, selecting 'handlersocket-mysql-5.1' for regex 'mysql*'
Note, selecting 'bacula-director-mysql' for regex 'mysql*'
Note, selecting 'handlersocket-mysql-5.5' for regex 'mysql*'
Note, selecting 'ruby-mysql2' for regex 'mysql*'
Note, selecting 'zabbix-proxy-mysql' for regex 'mysql*'
Note, selecting 'libmysql++-doc' for regex 'mysql*'
Note, selecting 'root-plugin-sql-mysql' for regex 'mysql*'
Note, selecting 'mysqltuner' for regex 'mysql*'
Note, selecting 'libmysqlcppconn-dev' for regex 'mysql*'
Note, selecting 'mysql-proxy' for regex 'mysql*'
Note, selecting 'libdbd-mysql-ruby1.8' for regex 'mysql*'
Note, selecting 'mha4mysql-node' for regex 'mysql*'
Note, selecting 'puppet-module-puppetlabs-mysql' for regex 'mysql*'
Note, selecting 'mysql-client-5.0' for regex 'mysql*'
Note, selecting 'mysql-client-5.1' for regex 'mysql*'
Note, selecting 'mysql-client-5.5' for regex 'mysql*'
Note, selecting 'mysql-client-5.6' for regex 'mysql*'
Note, selecting 'proftpd-mod-mysql' for regex 'mysql*'
Note, selecting 'mysql-workbench' for regex 'mysql*'
Note, selecting 'libghc-hsql-mysql-doc' for regex 'mysql*'
Note, selecting 'cl-sql-mysql' for regex 'mysql*'
Note, selecting 'lfc-mysql' for regex 'mysql*'
Note, selecting 'libaprutil1-dbd-mysql' for regex 'mysql*'
Note, selecting 'voms-mysql-plugin' for regex 'mysql*'
Note, selecting 'rsyslog-mysql' for regex 'mysql*'
Note, selecting 'oar-user-mysql' for regex 'mysql*'
Note, selecting 'dovecot-mysql' for regex 'mysql*'
Note, selecting 'lua-sql-mysql-dev' for regex 'mysql*'
Note, selecting 'mysqmail-postfix-logger' for regex 'mysql*'
Note, selecting 'libapache2-mod-log-sql-mysql' for regex 'mysql*'
Note, selecting 'php5-mysqlnd-ms' for regex 'mysql*'
Note, selecting 'mysql-workbench-gpl' for regex 'mysql*'
Note, selecting 'bacula-common-mysql' for regex 'mysql*'
Note, selecting 'courier-authmysql' for regex 'mysql*'
Note, selecting 'virtual-mysql-client-core' for regex 'mysql*'
Note, selecting 'python2.3-mysqldb' for regex 'mysql*'
Note, selecting 'libwtdbomysql-dev' for regex 'mysql*'
Note, selecting 'virtual-mysql-server-core' for regex 'mysql*'
Note, selecting 'perdition-mysql' for regex 'mysql*'
Note, selecting 'mysql-common' for regex 'mysql*'
Note, selecting 'bacula-common-mysql-dbg' for regex 'mysql*'
Note, selecting 'tarantool-mysql-plugin' for regex 'mysql*'
Note, selecting 'libnss-mysql' for regex 'mysql*'
Note, selecting 'libmysqld-pic' for regex 'mysql*'
Note, selecting 'dpm-mysql-srmv1' for regex 'mysql*'
Note, selecting 'dpm-mysql-srmv2' for regex 'mysql*'
Note, selecting 'nuauth-log-mysql' for regex 'mysql*'
Note, selecting 'mysqmail-courier-logger' for regex 'mysql*'
Note, selecting 'roundcube-mysql' for regex 'mysql*'
Note, selecting 'ruby-dbd-mysql' for regex 'mysql*'
Note, selecting 'gnokii-smsd-mysql' for regex 'mysql*'
Note, selecting 'libclass-dbi-mysql-perl' for regex 'mysql*'
Note, selecting 'pennmush-mysql' for regex 'mysql*'
Note, selecting 'freeradius-mysql' for regex 'mysql*'
Note, selecting 'libpam-mysql' for regex 'mysql*'
Note, selecting 'libmysqlclient18' for regex 'mysql*'
Note, selecting 'libmysqlclient14-dev' for regex 'mysql*'
Note, selecting 'librdf-storage-mysql' for regex 'mysql*'
Note, selecting 'ruby-mysql' for regex 'mysql*'
Note, selecting 'snort-mysql' for regex 'mysql*'
Note, selecting 'spl-mysql' for regex 'mysql*'
Note, selecting 'libdbd-mysql' for regex 'mysql*'
Note, selecting 'node-mysql' for regex 'mysql*'
Note, selecting 'mysql-testsuite' for regex 'mysql*'
Note, selecting 'libmysqlclient-dev' for regex 'mysql*'
Note, selecting 'libghc-hsql-mysql-dev-1.8.2-e92cc' for regex 'mysql*'
Note, selecting 'bacula-director-mysql-dbg' for regex 'mysql*'
Note, selecting 'dpm-srm-server-mysql' for regex 'mysql*'
Note, selecting 'php5-mysqlnd' for regex 'mysql*'
Note, selecting 'libopendbx1-mysql' for regex 'mysql*'
Note, selecting 'python-mysqldb' for regex 'mysql*'
Note, selecting 'libreoffice-mysql-connector' for regex 'mysql*'
Note, selecting 'libgda-5.0-mysql' for regex 'mysql*'
Note, selecting 'zabbix-server-mysql' for regex 'mysql*'
Note, selecting 'opendnssec-dbg-mysql' for regex 'mysql*'
Note, selecting 'libdatetime-format-mysql-perl' for regex 'mysql*'
Note, selecting 'libghc6-hsql-mysql-doc' for regex 'mysql*'
Note, selecting 'libapache2-mod-auth-mysql' for regex 'mysql*'
Note, selecting 'libmysql-ocaml-dev' for regex 'mysql*'
Note, selecting 'libtime-piece-mysql-perl' for regex 'mysql*'
Note, selecting 'dpm-mysql-copyd' for regex 'mysql*'
Note, selecting 'monodoc-mysql5.0-manual' for regex 'mysql*'
Note, selecting 'dsyslog-module-mysql' for regex 'mysql*'
Note, selecting 'libmysql-ocaml-dev-ddr32' for regex 'mysql*'
Note, selecting 'monodoc-mysql-manual' for regex 'mysql*'
Note, selecting 'mha4mysql-manager' for regex 'mysql*'
Note, selecting 'gsql-mysql-engine' for regex 'mysql*'
Note, selecting 'rt4-db-mysql' for regex 'mysql*'
Note, selecting 'libmysql-ocaml-ddr32' for regex 'mysql*'
Note, selecting 'lighttpd-mod-mysql-vhost' for regex 'mysql*'
Note, selecting 'libmysqlclient15-dev' for regex 'mysql*'
Note, selecting 'mysql-server' for regex 'mysql*'
Note, selecting 'opensips-mysql-module' for regex 'mysql*'
Note, selecting 'ndoutils-nagios2-mysql' for regex 'mysql*'
Note, selecting 'mysql-server-core' for regex 'mysql*'
Note, selecting 'lfc-server-mysql' for regex 'mysql*'
Note, selecting 'ratbox-services-mysql' for regex 'mysql*'
Note, selecting 'mysqmail' for regex 'mysql*'
Note, selecting 'ndoutils-mysql' for regex 'mysql*'
Note, selecting 'python-mysqldb-dbg' for regex 'mysql*'
Note, selecting 'libmysql-ocaml' for regex 'mysql*'
Note, selecting 'mysqmail-pure-ftpd-logger' for regex 'mysql*'
Note, selecting 'jabberd2-ldap-mysql' for regex 'mysql*'
Note, selecting 'dpm-mysql-nameserver' for regex 'mysql*'
Note, selecting 'gambas3-gb-db-mysql' for regex 'mysql*'
Note, selecting 'python3-mysql.connector' for regex 'mysql*'
Note, selecting 'libmysql6.4-cil' for regex 'mysql*'
Note, selecting 'libmysqld-dev' for regex 'mysql*'
Note, selecting 'libdbd-mysql-perl' for regex 'mysql*'
Note, selecting 'virtual-mysql-server' for regex 'mysql*'
Note, selecting 'dpm-name-server-mysql' for regex 'mysql*'
Note, selecting 'libmysql-diff-perl' for regex 'mysql*'
Note, selecting 'dpm-server-mysql' for regex 'mysql*'
Note, selecting 'lua5.2-sql-mysql' for regex 'mysql*'
Note, selecting 'lua5.1-dbi-mysql' for regex 'mysql*'
Note, selecting 'ndoutils-nagios3-mysql' for regex 'mysql*'
Note, selecting 'php-mdb2-driver-mysql' for regex 'mysql*'
Note, selecting 'libpocomysql9' for regex 'mysql*'
Note, selecting 'redmine-mysql' for regex 'mysql*'
Note, selecting 'opendnssec-enforcer-mysql' for regex 'mysql*'
Note, selecting 'ruby-dataobjects-mysql' for regex 'mysql*'
Package 'libmysqlclient10-dev' is not installed, so not removed
Package 'libmysqlclient12-dev' is not installed, so not removed
Package 'libmysqlclient14-dev' is not installed, so not removed
Note, selecting 'libmysqlclient-dev' instead of 'libmysqlclient15-dev'
Package 'mysql-client-5.0' is not installed, so not removed
Package 'mysql-client-5.1' is not installed, so not removed
Package 'mysql-client-core-5.1' is not installed, so not removed
Package 'mysql-server-5.1' is not installed, so not removed
Package 'mysql-server-core-5.1' is not installed, so not removed
Package 'mysql-server-5.0' is not installed, so not removed
Package 'mysql-server-core-5.0' is not installed, so not removed
Note, selecting 'mysql-server-core-5.5' instead of 'mysql-server-core'
Package 'php5-mysqli' is not installed, so not removed
Package 'python2.3-mysqldb' is not installed, so not removed
Package 'python2.4-mysqldb' is not installed, so not removed
Note, selecting 'python-mysqldb' instead of 'python2.7-mysqldb'
Package 'courier-authmysql' is not installed, so not removed
Note, selecting 'dpm-copy-server-mysql' instead of 'dpm-mysql-copyd'
Note, selecting 'dpm-name-server-mysql' instead of 'dpm-mysql-nameserver'
Note, selecting 'dpm-server-mysql' instead of 'dpm-mysql'
Note, selecting 'dpm-srm-server-mysql' instead of 'dpm-mysql-srmv1'
Note, selecting 'dpm-srm-server-mysql' instead of 'dpm-mysql-srmv2'
Note, selecting 'dpm-srm-server-mysql' instead of 'dpm-mysql-srmv22'
Package 'libqt4-sql-mysql' is not installed, so not removed. Did you mean 'libqt4-sql-mysql:i386'?
Package 'mysql-client' is not installed, so not removed
Package 'mysql-server-5.5' is not installed, so not removed
Package 'postfix-mysql' is not installed, so not removed
Package 'strongswan-plugin-mysql' is not installed, so not removed
Package 'akonadi-backend-mysql' is not installed, so not removed
Package 'dovecot-mysql' is not installed, so not removed
Package 'libmysqld-pic' is not installed, so not removed
Package 'libqt5sql5-mysql' is not installed, so not removed
Package 'libreoffice-mysql-connector' is not installed, so not removed
Package 'mysql-source-5.5' is not installed, so not removed
Package 'mysql-testsuite' is not installed, so not removed
Package 'mysql-testsuite-5.5' is not installed, so not removed
Package 'php5-mysqlnd' is not installed, so not removed
Package 'rsyslog-mysql' is not installed, so not removed
Package 'pdns-backend-mysql' is not installed, so not removed
Package 'mysql-client-5.6' is not installed, so not removed
Package 'mysql-client-core-5.6' is not installed, so not removed
Package 'mysql-server-core-5.6' is not installed, so not removed
Package 'mysql-source-5.6' is not installed, so not removed
Package 'mysql-testsuite-5.6' is not installed, so not removed
Package 'opensips-mysql-module' is not installed, so not removed
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
 libmysqlclient18:i386 : Depends: mysql-common:i386 (>= 5.5.44-0ubuntu0.14.04.1)
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

我得到之后apt-get -f install

Preconfiguring packages ... 
(Reading database ... 625805 files and directories currently installed.) 
Preparing to unpack .../mysql-server-5.5_5.5.44-0ubuntu0.14.04.1_amd64.deb ... 
Aborting downgrade from (at least) 5.6 to 5.5. If are sure you want to downgrade to 5.5, remove the file /var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.5_5.5.44-0ubuntu0.14.04.1_amd64.deb (--unpack): subprocess new pre-installation script returned error exit status 1 
Errors were encountered while processing: /var/cache/apt/archives/mysql-server-5.5_5.5.44-0ubuntu0.14.04.1_amd64.deb 
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

要删除文件,请使用例如:sudo rm -rf /var/lib/mysql/debian-*.flag

要查看存在哪些标志:sudo ls -al /var/lib/mysql/debian-*

答案2

尝试这个

sudo apt-get clean 
sudo apt-get update 
sudo apt-get install -f 
sudo dpkg-recofigure -a

答案3

如果确定要降级到 5.5,请删除文件 /var/lib/mysql/debian-*.flag 并尝试再次安装。

相关内容