1

After install some update to ubuntu17.04 and remove mysql-server with autoremove, I meet this error:

mysql-server-5.7 : 依赖(dependent): initscripts 但无法安装它(but can't install it)
sudo apt install initscripts
# 没有可用的软件包 initscripts,但是它被其它的软件包引用了
# 这可能意味着这个缺失的软件包可能已被废弃,
# 或者只能在其他发布源中找到
# no valid package initscripts,but it referred by other package
# this means it may be abandoned, or can be found in other repo
# replaced by following
# sysvinit-utils util-linux:i386 sysvinit-utils:i386 util-linux

with sudo apt install mysql-server-5.7. I have tried 16-04-upgrade-broke-mysql-server, but still break with above problem!

Cheney
  • 121
  • 5

1 Answers1

1

This is solved by update with MySQL APT Repository

sudo dpkg -i mysql-apt-config_0.8.7-1_all.deb
sudo apt update

and select 5.7 with OK

  1. backup configure file and databases
  2. sudo rm /etc/alternatives/my.cnf /etc/mysql -fr
  3. sudo rm /var/lib/mysql/* -fr
  4. sudo apt remove mysql-server mysql-client mysql-community-client --purge
  5. sudo mkdir -p /etc/mysql/conf.d/

    else error with mysql-server (--configure) ==> /etc/mysql/conf.d/ not found in /etc/init.d/mysql restart

  6. sudo apt install mysql-server mysql-client --fix-broken --fix-missing

  7. restore configure_files and databases with the backup files
  8. /etc/init.d/mysql restart

Hope this will save your time! Good Luck!

BTW: Failed to start mysql.service: Unit mysql.service is masked ==> systemctl unmask mysql.service
MARK: dpkg-query -l mysql* to queuy state of package.

Cheney
  • 121
  • 5