ubuntu更新遇到lock问题

问题

ubuntu使用apt-get updtae报错

1
2
3
4
ubuntu@ubuntu:~$ sudo apt-get update
Reading package lists... Done
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/

解决办法

1
2
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock

然后就可以apt-get update操作了