ubuntu执行apt-get时出错

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?

 

1:问题原因:主要是因为apt还在运行。

2:解决方案:杀死所有的apt进程。

  查找所有apt相关的进程,并用命令杀死。

1 szf@1:~$ ps afx|grep apt
2  3284 pts/0    S+     0:00          \_ grep --color=auto apt
3  2869 ?        Ss     0:00 /bin/sh /usr/lib/apt/apt.systemd.daily install
4  2873 ?        S      0:00  \_ /bin/sh /usr/lib/apt/apt.systemd.daily lock_is_held install
5 
6 szf@1:~$ sudo kill -9 2873
7 szf@1:~$ sudo kill -9 2869

 

posted @ 2020-10-21 15:16  蒲城小农  阅读(321)  评论(0)    收藏  举报