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
  • 相关阅读:
    必须要狠狠的喷一把苹果
    机械键盘四种轴试用体验
    linux终端快捷键
    挥别我在软件开发的第一个公司
    mysql 查询优化
    oracle 用户创建这个挺靠谱
    重置了下系统好多关于mysql密码的文章都很渣拷分好的备用
    关于WebView的复习
    Bpmx实施经验
    使用Nexus私服代理其他maven仓库(jitpack、jcenter)
  • 原文地址:https://www.cnblogs.com/chenzhong-w/p/11371870.html
Copyright © 2011-2022 走看看