Я установил mysql-server
на моем Ubuntu 16.04 LTS и это сработало очень хорошо ...
Далее я установил mariadb-server
и mariadb-client
. Были некоторые связи с MySQL поэтому я решил принудительно удалить все MariaDB составные части. После этого у меня возникли проблемы с MySQL. Поэтому я решаю принудительно переустановить MySQL...
Я не мог удалить mysql-server
потому что после удаления остались неудовлетворенные зависимости MariaDB...
Поэтому я перепробовал все возможные комбинации с apt-get
и dpkg
насильно удалить остатки MySQL и MariaDB... Наконец, к сожалению, я также вручную удалил все файлы в дереве каталогов, которые содержали что-либо в имени из MySQL или MariaDB...
$ sudo dpkg --audit
The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure
menu option in dselect for them to work:
mysql-server MySQL Server meta package depending on latest version
The following packages are missing the list control file in the
database, they need to be reinstalled:
mariadb-client MariaDB database client (metapackage depending on the lat
mariadb-server-10.0 MariaDB database server binaries
mariadb-server-core-10.0 MariaDB database core server files
The following packages are missing the md5sums control file in the
database, they need to be reinstalled:
mariadb-client MariaDB database client (metapackage depending on the lat
mariadb-server-10.0 MariaDB database server binaries
mariadb-server-core-10.0 MariaDB database core server files
Но я все еще не могу переустановить MySQL потому что зависимости, связанные с MariaDB отсутствуют и наоборот ...
$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.7.22-1ubuntu16.04).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
mariadb-client : Depends: mariadb-client-10.0 (>= 10.0.34-0ubuntu0.16.04.1) but it is not going to be installed
mariadb-server-10.0 : PreDepends: mariadb-common (>= 10.0.34-0ubuntu0.16.04.1) but it is not going to be installed
Depends: mariadb-client-10.0 (>= 10.0.34-0ubuntu0.16.04.1) but it is not going to be installed
Breaks: mysql-server
mariadb-server-core-10.0 : Depends: mariadb-common (>= 10.0.34-0ubuntu0.16.04.1) but it is not going to be installed
mysql-server : Depends: mysql-community-server (= 5.7.22-1ubuntu16.04) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
$ sudo dpkg --configure mysql-server
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-community-server (= 5.7.22-1ubuntu16.04); however:
Package mysql-community-server is not installed.
mariadb-server-10.0 (10.0.34-0ubuntu0.16.04.1) breaks mysql-server and is installed.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server
И еще объявления:
$ sudo dpkg --list | grep -i mysql
ii dbconfig-mysql 2.0.4ubuntu1 all dbconfig-common MySQL/MariaDB support
ii libdbd-mysql-perl 4.033-1ubuntu0.1 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient20:amd64 5.7.22-0ubuntu0.16.04.1 amd64 MySQL database client library
ii mysql-apt-config 0.8.9-1 all Auto configuration for MySQL APT Repo.
ii mysql-common 5.7.22-0ubuntu0.16.04.1 all MySQL database common files, e.g. /etc/mysql/my.cnf
iU mysql-server 5.7.22-1ubuntu16.04 amd64 MySQL Server meta package depending on latest version
rc mysql-server-5.7 5.7.22-0ubuntu0.16.04.1 amd64 MySQL database server binaries and system database setup
ii php-mysql 1:7.2+60+ubuntu16.04.1+deb.sury.org+1 all MySQL module for PHP [default]
ii php5.6-mysql 5.6.35-1+ubuntu16.04.1+deb.sury.org+1 amd64 MySQL module for PHP
ii php7.2-mysql 7.2.5-1+ubuntu16.04.1+deb.sury.org+1 amd64 MySQL module for PHP
ii phpmyadmin 4:4.5.4.1-2ubuntu2 all MySQL web administration tool
ii python-pymysql 0.7.2-1ubuntu1 all Pure-Python MySQL driver - Python 2.x
$ sudo dpkg --list | grep -i mariadb
ii dbconfig-mysql 2.0.4ubuntu1 all dbconfig-common MySQL/MariaDB support
ii mariadb-client 10.0.34-0ubuntu0.16.04.1 all MariaDB database client (metapackage depending on the latest version)
ii mariadb-server-10.0 10.0.34-0ubuntu0.16.04.1 amd64 MariaDB database server binaries
ii mariadb-server-core-10.0 10.0.34-0ubuntu0.16.04.1 amd64 MariaDB database core server files
$ sudo dpkg -i | grep mysql
dpkg: error: --install needs at least one package archive file argument
$ sudo dpkg -i | grep mariadb
dpkg: error: --install needs at least one package archive file argument
На самом деле мне нужно иметь MySQL в моей системе, но я не могу переустановить Ubuntu.
Я знаю, что сам наделал много проблем, но, может быть, кто-нибудь умнее меня может посоветовать что-нибудь, что может быть мне полезно.
Я считаю, что решение этой проблемы может помочь многим людям в подобной ситуации, которая может случиться и с другими сервисами.
Бог существует! : D
Проблема была решена введением:
sudo apt-get -f install
без других параметров
а затем отображение всех пакетов через:
sudo dpkg -l | grep mariadb
sudo dpkg -l | grep mysql
и удаляем проблемные пакеты в правильном порядке:
sudo apt-get --purge autoremove package_name
После полного удаления всех проблемных пакетов я мог переустановить MySQL без проблем ...
Спасибо @MarkWagner за вашу помощь.