zoukankan      html  css  js  c++  java
  • Unable to acquire the dpkg frontend lock

    当运行sudo apt-get install/update/其他命令时,会出现如下提示:

    E: 无法获得锁 /var/lib/dpkg/lock-frontend - open (11: 资源暂时不可用)
    E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

    出现这个问题的原因可能是:

    在ubuntu系统的termial下,用apt-get install 安装软件的时候,如果在未完成下载的情况下将terminal close。此时 apt-get进程可能没有结束。结果,如果再次运行apt-get install 命令安装软件时,出现如上错误。即有另一个程序正在占用apt-get install进程,由于它在运行时,会占用软件源更新时的系统锁(简称‘系统更新锁’),此时资源被锁。

    我们只需要杀死之前的进程,释放系统锁就可以了:

    ps -A|grep apt
    显示

    921 ? 00:00:01 apt
    然后执行

    sudo kill 921
    ————————————————
    ps -A 显示所有进程,

    grep apt 查找包含字符apt的进程

    wczlinux@ubuntu:~/test$ sudo apt install gcc
    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?
    wczlinux@ubuntu:~/test$ ps -A|grep apt
       921 ?        00:00:00 apt.systemd.dai
       961 ?        00:00:00 apt.systemd.dai
    wczlinux@ubuntu:~/test$ sudo kill 921
    wczlinux@ubuntu:~/test$ sudo kill 961
    kill: (961): No such process
    wczlinux@ubuntu:~/test$ gcc
  • 相关阅读:
    网络爬虫基础练习
    词频统计预处理
    将博客搬至CSDN
    内核探测工具systemtap简介(转)
    常用汉字的Unicode码表
    随机生成登录时的验证码图片
    response中用outputstream输出中文问题
    ServletContext读取web应用中的资源文件
    ServletContext
    URL描述web资源访问流程
  • 原文地址:https://www.cnblogs.com/chenzhong-w/p/11371870.html
Copyright © 2011-2022 走看看