安装MYSQL中断后,报错

问题:安装MYSQL时报错,是因为之前安装时,没有网络,中断过

root@ubuntu:/etc/init.d# sudo apt-get install mysql-server
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

采取的办法是:

root@ubuntu:~# lsof /var/lib/dpkg/lock-frontend
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
apt-get 2564 root 4uW REG 8,1 0 413925 /var/lib/dpkg/lock-frontend

root@ubuntu:~# sudo kill -9 2564   注意‘-9’,如果不加,不会成功
root@ubuntu:~# lsof /var/lib/dpkg/lock-frontend

root@ubuntu:~# sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libaio1 libevent-core-2.1-6 libhtml-template-perl mysql-client-5.7
mysql-client-core-5.7 mysql-server-5.7 mysql-server-core-5.7
Suggested packages:
libipc-sharedcache-perl mailx tinyca
The following NEW packages will be installed:
libaio1 libevent-core-2.1-6 libhtml-template-perl mysql-client-5.7
mysql-client-core-5.7 mysql-server mysql-server-5.7 mysql-server-core-5.7
0 upgraded, 8 newly installed, 0 to remove and 238 not upgraded.
Need to get 20.5 MB of archives.
After this operation, 160 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

原文地址:https://www.cnblogs.com/sike8/p/11023049.html