美文网首页
Ubuntu出现dpkg: error processing p

Ubuntu出现dpkg: error processing p

作者: WMSmile | 来源:发表于2022-02-17 13:36 被阅读0次

    Ubuntu出现dpkg: error processing package mysql-community-server (--configure):问题

    无论使用 sudo apt upgrade 还是 sudo apt autoremove 问题依旧。

    使用mysql deb包安装出错

    sudo apt upgrade
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    The following packages have been kept back:
      libmysqlclient-dev mysql-client mysql-server mysql-testsuite
    0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
    4 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Setting up mysql-community-server (5.7.37-1ubuntu18.04) ...
    update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist
    dpkg: error processing package mysql-community-server (--configure):
     installed mysql-community-server package post-installation script subprocess returned error exit status 2
    dpkg: dependency problems prevent configuration of mysql-server:
     mysql-server depends on mysql-community-server (= 5.7.37-1ubuntu18.04); however:
      Package mysql-community-server is not configured yet.
    
    dpkg: error processing package mysql-server (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of mysql-community-test:No apport report written because the error message indicates its a followup error from a previous failure.
    
     mysql-community-test depends on mysql-community-server (= 5.7.37-1ubuntu18.04); however:
      Package mysql-community-server is not configured yet.
    
    dpkg: error processing package mysql-community-test (--configure):
     dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of mysql-testsuite:No apport report written because the error message indicates its a followup error from a previous failure.
    
     mysql-testsuite depends on mysql-community-test (= 5.7.37-1ubuntu18.04); however:
      Package mysql-community-test is not configured yet.
    
    dpkg: error processing package mysql-testsuite (--configure):
     dependency problems - leaving unconfigured
    No apport report written because MaxReports is reached already
    

    解决办法如下:

    尝试使用以下命令

    sudo apt-get install -f
    

    来查看它是否能修复破坏的依赖项.

    如果失败,清除MySQL服务器:

     sudo apt-get purge mysql-community-server mysql-community-server 
    

    然后清理并更新:

     sudo apt-get autoclean && sudo apt-get clean && sudo apt-get update 
    

    做一般升级:

     sudo apt-get upgrade 
    

    现在尝试重新安装:

    sudo apt-get install mysql-server and mysql-community-server 
    

    如果从root提示符执行此操作,则不会引导前导sudo命令.

    相关文章

      网友评论

          本文标题:Ubuntu出现dpkg: error processing p

          本文链接:https://www.haomeiwen.com/subject/fqqslrtx.html