1

I'm working on my VPS with Ubuntu 16.04 installed. Today while running sudo apt-get install git-core curl I have approached error:

Setting up mysql-common (5.7.15-0ubuntu0.16.04.1) ...
update-alternatives: error: alternative path /etc/mysql/my.cnf.fallback doesn't exist
dpkg: error processing package mysql-common (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of libmysqlclient20:amd64:
 libmysqlclient20:amd64 depends on mysql-common (>= 5.5); however:
  Package mysql-common is not configured yet.

dpkg: error processing package libmysqlclient20:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libdbd-mysql-perl:No apport report written because the error message indicates its a followup error from a previous failure.

 libdbd-mysql-perl depends on libmysqlclient20 (>= 5.7.11); however:
  Package libmysqlclient20:amd64 is not configured yet.

dpkg: error processing package libdbd-mysql-perl (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-client-5.6:No apport report written because the error message indicates its a followup error from a previous failure.

 mysql-client-5.6 depends on libdbd-mysql-perl (>= 1.2202); however:
  Package libdbd-mysql-perl is not configured yet.
 mysql-client-5.6 depends on mysql-common (>= 5.5); however:
  Package mysql-common is not configured yet.

dpkg: error processing package mysql-client-5.6 (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 mysql-common
 libmysqlclient20:amd64
 libdbd-mysql-perl
 mysql-client-5.6

I found out that probably my mysql packages are corrupted and I have to fix them. I'm running older - mysql 5.6 version because of compatibility purposes of Jira, Confluence and Bitbucket apps which I'm hosting.

I have tried several solutions to slove the problem but everything fails during sudo dpkg -r mysql-common command.

dpkg: dependency problems prevent removal of mysql-common:
 libmysqlclient20:amd64 depends on mysql-common (>= 5.5).
 mysql-client-5.6 depends on mysql-common (>= 5.5); however:
  Package mysql-common is to be removed.

dpkg: error processing package mysql-common (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 mysql-common

Without understanding at all what I'm doing I have removed mysql-server with sudo apt-get remove --purge commands. Everything without resolving a problem with mysql-common.

Fresh installation of mysql via sudo apt install mysql-server-5.6 command also leads to problem with mysql-common.

I feel that the last thing I can do is complete removal of mysql related files, but before I have to do a backup of my users and databases.

I can't do with mysqldump. Is there any possibility to backup everything with working just on files?

1

Well, yes. But you should write down the version which was last working with mysql data directory, because moving to a newer major release cannot be done with just copying the files. So, back up your mysql data directory - just in case. I would create a separate tar.gz archive just to be safe. Then you have several options.

  • remove all of the conflicting packages, then install proper one using your package manager. If the version of the latter one will be of different version, than the mysql server you previously used, you will need a mysql dump for each database.
  • if your package manager is unable to provide this version explicitely, then the most easy way of obtaing them would be to build the mysql server of the version needed from sources, install it in custom prefix and launch it by hand, pointing your mysql data directory, then performing a dump.
  • I need to provide the same version of mysql because of atlassian software - it cannot be run on 5.7 mysql version. As I understand everything I have to do is just make copy of /etc/mysql and /var/lib/mysql folders and then after fresh instalation of my mysql 5.6 ver just copy, paste them. – Gregy Oct 10 '16 at 6:18
  • As long as you retain same major release (e.g. 5.6.x to any 5.6.x) - yes. But considering the package mess you are currently in, you can end easily with 5.7.x. In the latter case you will need some additional ways to emerge, and building 5.6.x from sources into a custom prefix is one of them. – drookie Oct 10 '16 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.