0

I tried to install a package, but there was some kind of problem with dependencies. First I tried to clean up everything with the command sudo apt-get autoremove and I got a similar error message as with apt-get install

Output after autoremove

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up apache2 (2.4.18-2ubuntu3.5) ...
info: Executing deferred 'a2enconf javascript-common' for package javascript-common
ERROR: Conf javascript-common does not exist!
dpkg: error processing package apache2 (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up mysql-common (5.7.20-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 mysql-client-5.7:
 mysql-client-5.7 depends on mysql-common (>= 5.5); however:
 Package mysql-common is not configured yet.

dpkg: error processing package mysql-client-5.7 (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                      No apport report written because MaxReports is reached already
Errors were encountered while processing:
 apache2
 mysql-common
 libmysqlclient20:amd64
 mysql-client-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any solutions? Seems there is some problem with the packages apache2, mysql-common etc. but I got no idea since I'm not very experienced with the command line.

Zanna
  • 70,465
Ian Fako
  • 111
  • "autoremove" does not correct such errors. It merely removes orphaned packages that are no longer needed. –  Nov 18 '17 at 18:14

1 Answers1

0

First of all do backup of your databases, if you have some valuable data there.

backup can be done with

mysqldump -u{username} -p{password} {database_name} > {desired_file_name}.sql

notice that there is no space between -u and username and between -p and password

Then completely purge mysql and re-install it if needed

you can find how to purge mysql here or here

Anton
  • 64