Upgrade to 16.04. Broken dependencies and impossibility to resolve them in usual ways

6,990

Run the following commands:

mkdir MYSQL
cd MYSQL
sudo apt-get download mysql-common
ar xvf mysql*
tar xvf dat*
sudo cp ./etc/mysql/my.cnf.fallback /etc/mysql/my.cnf.fallback
sudo dpkg -i mysql*deb 
cd
sudo apt-get -f install
Share:
6,990

Related videos on Youtube

KeRo
Author by

KeRo

Updated on September 18, 2022

Comments

  • KeRo
    KeRo over 1 year

    I upgraded the system some days ago and after that I had a problem of broken packages which affects to MySQL and several libraries. After that I can do updates but not install, upgrade, remove or purge packages, and I don’t find any way to resolve the problem of broken dependencies.

    I’m not sure whether the problem of the broken dependencies and of MySQL are directly related or not, then I will try to describe both separately.

    First if I try to install a package or make an upgrade, I get following message:

    $ sudo apt-get upgrade
    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:
    libsasl2-modules:i386 : Depends: libssl1.0.0:i386 (>= 1.0.0) but it is not installed
    skype-bin:i386 : Depends: libssl1.0.0:i386 but it is not installed
    E: Unmet dependencies. Try using -f.
    

    If I use the upgrade -f option then I get

    $ sudo apt-get -f upgrade
    Reading package lists... Done
    Building dependency tree   
    Reading state information... Done
    Correcting dependencies... Done
    Calculating upgrade... Done
    The following NEW packages will be installed:
      libssl1.0.0:i386
    The following packages will be upgraded:
      snapd
    1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    3 not fully installed or removed.
    Need to get 0 B/5,235 kB of archives.
    After this operation, 6,545 kB of additional disk space will be used.
    Do you want to continue? [Y/n] Y
    Preconfiguring packages ...
    Setting up mysql-common (5.7.12-0ubuntu1.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
    Errors were encountered while processing:
     mysql-common
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    Looking with Synaptic I see following broken packages

    libsasl2-modules;i386
    skype-bin:i386
    

    Here if I try to remove, reinstall or whatever I get with Synaptic always the same error message

    E: mysql-common: subprocess installed post-installation script returned error exit status 2
    

    If I try to configure MySQL (what is installed theoretically in the newest version) then I get this message:

    $ sudo dpkg --configure -a
    Setting up mysql-common (5.7.12-0ubuntu1.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 mysql-server-5.7:
     mysql-server-5.7 depends on mysql-common (>= 5.6.22-1~); however:
      Package mysql-common is not configured yet.
     mysql-server-5.7 depends on mysql-common (>= 5.5); however:
      Package mysql-common is not configured yet.
    
    dpkg: error processing package mysql-server-5.7 (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of mysql-server:
     mysql-server depends on mysql-server-5.7; however:
      Package mysql-server-5.7 is not configured yet.
    
    dpkg: error processing package mysql-server (--configure):
     dependency problems - leaving unconfigured
    Errors were encountered while processing:
     mysql-common
     mysql-server-5.7
     mysql-server
    

    In the upgrade of MySQL something were really weird. For instance, looking for the files my.cnf, my.cnf.fallback etc... I realized that the files and their folders don’t exist anymore. I ignore how they disappear during the upgrade.

    Trying to reinstall MySQL without any hope I got this messages:

    $ sudo apt-get -f install mysql-common
    Reading package lists... Done
    Building dependency tree   
    Reading state information... Done
    mysql-common is already the newest version (5.7.12-0ubuntu1.1).
    You might want to run 'apt-get -f install' to correct these:
    The following packages have unmet dependencies:
     libsasl2-modules:i386 : Depends: libssl1.0.0:i386 (>= 1.0.0) but it is not going to be installed
     skype-bin:i386 : Depends: libssl1.0.0:i386 but it is not going to be installed
    E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
    

    If I use purge to deinstall them and begin from scratch, then I have the same problems

    $ sudo apt-get purge mysql-common
    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:
     libmysqlclient18 : Depends: mysql-common (>= 5.5) but it is not going to be installed
     libmysqlclient18:i386 : Depends: mysql-common:i386 (>= 5.5)
     libmysqlclient20 : Depends: mysql-common (>= 5.5) but it is not going to be installed
     libsasl2-modules:i386 : Depends: libssl1.0.0:i386 (>= 1.0.0) but it is not going to be installed
     mysql-client-5.7 : Depends: mysql-common (>= 5.5) but it is not going to be installed
     mysql-server-5.7 : PreDepends: mysql-common (>= 5.5) but it is not going to be installed
    Depends: mysql-common (>= 5.6.22-1~) but it is not going to be installed
     skype-bin:i386 : Depends: libssl1.0.0:i386 but it is not going to be installed
    E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
    

    If I try apt-get -f install then I get

    $ sudo apt-get -f install
    [sudo] password for user: 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Correcting dependencies... Done
    The following additional packages will be installed:
      libssl1.0.0:i386
    The following NEW packages will be installed:
      libssl1.0.0:i386
    0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
    3 not fully installed or removed.
    Need to get 0 B/949 kB of archives.
    After this operation, 3,207 kB of additional disk space will be used.
    Do you want to continue? [Y/n] Y
    Preconfiguring packages ...
    Setting up mysql-common (5.7.12-0ubuntu1.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
    Errors were encountered while processing:
     mysql-common
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    Somebody has an idea, what I can do?

    • David Foerster
      David Foerster almost 8 years
      Did you try the part about circumventing Apt? It took me a few minutes to extend the answer accordingly and you might have missed it. It's the same procedure as mchid's answer.
    • KeRo
      KeRo almost 8 years
      Hi David, no... I think I missed this part. Thanks a lot for your help!!
  • wind39
    wind39 almost 8 years
    Great! Worked flawlessly.
  • jdog
    jdog about 7 years
    WOOT. And learned so much
  • stamster
    stamster almost 7 years
    Great. Worked on 16.04 LTS with MariaDB instead of MySQL.