I am not sure if it will work, but try this. First you need to uninstall anything that is related to mysql:
sudo apt-get purge mysql*sudo apt-get autoremovesudo apt-get autoclean
Then the important bit, this error could be caused because your distribution is not upgraded recently, or at least conflicts are not resolved properly. So next thing is to upgrade it like you did before but without removing first:
sudo apt-get dist-upgrade
Now after this is done, you can try to install mysql as normal again. Hope this will work, please give a report. If it doesnt work we'll try another fix.
ubuntu常见错误--Could not get lock /var/lib/dpkg/lock解决
通过终端安装程序sudo apt-get install xxx时出错:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it
出现这个问题可能是有另外一个程序正在运行,导致资源被锁不可用。而导致资源被锁的原因可能是上次运行安装或更新时没有正常完成,进而出现此状况,解决的办法其实很简单:
在终端中敲入以下两句
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a //自动调试
出现After this operation, 0 B of additional disk space will be used.Do you want to continue [Y/n]?
解决方法
cd /var/lib/dpkg
sudo mv info info.bak sudo mkdir info 然后apt-get install 或者 apt-get upgrade 再把info替换回去应该就可以了
or
apt-get install -f