导语:mysql5.7.2x升级到5.7.33的时候报错

apt install -f
Reading package lists… Done
Building dependency tree
Reading state information… Done
0 upgraded, 0 newly installed, 0 to remove and 113 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.7 (5.7.33-0ubuntu0.16.04.1) …
insserv: warning: script ‘sshd.init’ missing LSB tags and overrides

dpkg: error processing package mysql-server-5.7 (–configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.7
E: Sub-process /usr/bin/dpkg returned an error code (1)

查看其实已经升级成功了。

image-20240604142102521

通过修改vi /var/lib/dpkg/info/mysql-server-5.7.postinst直接在bash的下一行 增加exit 0 后再执行dpkg --configure -a

image-20240604142114783

不报错了

image-20240604142458608

参考

https://stackoverflow.com/questions/43446218/dpkg-error-processing-package-mysql-server-dependency-problems?newreg=0f471a108ee8470dba78e3f15d27054b

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐