【问题标题】:mysql-server cant install on linux [closed]mysql-server无法在linux上安装[关闭]
【发布时间】:2017-11-07 23:20:37
【问题描述】:

我像这样删除了当前的mysql:

apt-get remove --purge mysql-server mysql-client mysql-common
apt-get remove --purge mysql-client-core-5.5
apt-get autoremove
apt-get autoclean
rm -rf /var/lib/mysql

当我想重新安装时,我遇到了一些问题:

apt-get install mysql-server 

//输出是

The following packages have unmet dependencies:
 mysql-server : Depends: mysql-server-5.5 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.**

再一次

apt-get install mysql-server-5.5 

//输出是

以下信息可能有助于解决问题:

The following packages have unmet dependencies:
mysql-server-5.5 : PreDepends: mysql-common (>= 5.5.47-0+deb7u1) but it is not going to be installed
Depends: mysql-client-5.5 (>= 5.5.47-0+deb7u1) but it is not going to be installed
Recommends: mailx
E: Unable to correct problems, you have held broken packages.

我已经安装了很多次mysql-commonmysql-clint-5.5

可能有什么问题?

【问题讨论】:

    标签: mysql linux installation reinstall


    【解决方案1】:

    我在我的 ubuntu 20.04 中编写了这个脚本来解决这个问题,请在我的 cmets 中查看详细信息:

    #!/bin/bash
    
    #Force install of missing deps
    sudo apt-get -f install -o Dpkg::Options::="--force-overwrite"
    
    #Remove the installed Apache 2
    sudo apt-get purge apache2\*
    
    #And followed by:
    sudo apt-get purge mysql\*
    sudo rm -rf /var/lib/mysql
    sudo rm -rf /etc/mysql
    sudo dpkg -l | grep -i mysql
    sudo apt-get clean
    sudo apt-get aut
    sudo updatedb
    
    #Reinstall full webstack if you want to.
    sudo apt-get install lamp-server^
    

    【讨论】:

    • 感谢您为我节省了大量时间的有用答案。
    【解决方案2】:

    我在 6 小时后解决了这个问题 :) 主要问题是版本号。卸载后你应该这样写:

    安装mysql服务器:

    首先安装mysql-server-5.5

    并安装mysql-server-5.5:

    安装mysql-common apt-get install mysql-common=5.5.47-0+deb7u1

    安装mysql-client-5.5 apt-get install mysql-client=5.5.47-0+deb7u1

    安装后: 安装 mysql-server-5.5 apt-get install mysql-server-5.5

    最后: 安装mysql-server mysql-client apt-get install mysql-server mysql-client

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-04-15
      • 2019-08-03
      • 1970-01-01
      • 1970-01-01
      • 2014-04-26
      • 1970-01-01
      • 2017-11-13
      • 2021-01-23
      相关资源
      最近更新 更多