ubuntu Could not get lock /var/lib/dpkg/lock解决方法

♀尐吖头ヾ 提交于 2020-01-09 12:30:53

  安装ubuntun ssh遇到以下问题

 

magicdepth@magicdepth-UP-APL01:~$ sudo apt-get install openssh-server
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?

 

/var/lib/dpkg/lock文件被锁定 被其他进程使用,查看其他使用apt进程

magicdepth@magicdepth-UP-APL01:~$ ps afx|grep apt
 2344 pts/7    S+     0:00          |       \_ grep --color=auto apt
 2140 ?        SNl    0:01 /usr/bin/python3 /usr/sbin/aptd
 2148 ?        SN     0:00  \_ /usr/lib/apt/methods/http
 2149 ?        SN     0:00  \_ /usr/lib/apt/methods/http
 2153 ?        SN     0:00  \_ /usr/lib/apt/methods/gpgv
 2327 ?        SN     0:01  \_ /usr/lib/apt/methods/store

将上述几个线程杀掉 解决问题

 

magicdepth@magicdepth-UP-APL01:~$ sudo kill -9 2148
magicdepth@magicdepth-UP-APL01:~$ sudo kill -9 2149
magicdepth@magicdepth-UP-APL01:~$ sudo kill -9 2153
magicdepth@magicdepth-UP-APL01:~$ sudo kill -9 2127

 

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!