Sub-process /usr/bin/dpkg returned an error code (1) Ubantu dpkg安装mysql-server-5.5软件包时报错解决办法

我是在安装mysql-server-5.5时,报错Sub-process /usr/bin/dpkg returned an error code (1),

全部卸载之前的所有以来的软件包,重新安装,还是报这个dpkg的错误,


sudo apt-get autoremove mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server-5.5 mysql-server-core-5.5 libnet-daemon-perl libplrpc-perl libterm-readkey-perl libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18


sudo apt-get install mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server-5.5 mysql-server-core-5.5 libnet-daemon-perl libplrpc-perl libterm-readkey-perl libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18

Sub-process /usr/bin/dpkg returned an error code (1)

解决方法是:

$cd /var/lib/dpkg/info

$sudo rm -rf mysql-*

$sudo apt-get autoremove mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server-5.5 mysql-server-core-5.5 libnet-daemon-perl libplrpc-perl libterm-readkey-perl libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18

$sudo apt-get install mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server-5.5 mysql-server-core-5.5 libnet-daemon-perl libplrpc-perl libterm-readkey-perl libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18

$mysql

mysql> exit
Bye

OK了

也可以执行下面这个方法二:

$cd /var/lib/dpkg/info

$sudo rm -rf mysql*

$sudo apt-get -f install

$sudo apt-get  update

你可能感兴趣的:(linux)