E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using

╰半橙微兮° 2023-01-22 14:50 107阅读 0赞

前言

最近在乌班图系统上面安装,命令rz,sz出现如下错误


  1. sudo apt-get install lrzsz
  2. E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
  3. E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

解决办法

使用ps 和 grep查找apt的pid,并使用kill杀死掉

  1. root@iZ8vb4poq26tme4bwexb4lZ:~# ps afx|grep apt
  2. 28301 pts/1 S+ 0:00 | | \_ grep --color=auto apt
  3. 25389 ? S< 0:00 sh -c { /usr/bin/apt-get install -y libmysqlclient20 -o Acquire::http::Timeout=5 --allow-unauthenticated -o Dir::Etc::SourceList=/usr/local/aegis/globalcfg/apt/aegis.list; } 2>&1
  4. 25390 ? S< 6:16 \_ /usr/bin/apt-get install -y libmysqlclient20 -o Acquire::http::Timeout=5 --allow-unauthenticated -o Dir::Etc::SourceList=/usr/local/aegis/globalcfg/apt/aegis.list
  5. kill 25389
  6. root@iZ8vb4poq26tme4bwexb4lZ:~# kill 25389
  7. root@iZ8vb4poq26tme4bwexb4lZ:~# psafx | grep apt
  8. psafx: command not found
  9. root@iZ8vb4poq26tme4bwexb4lZ:~# ps afx | grep apt
  10. 30450 pts/1 S+ 0:00 | | \_ grep --color=auto apt
  11. 25390 ? S< 6:16 /usr/bin/apt-get install -y libmysqlclient20 -o Acquire::http::Timeout=5 --allow-unauthenticated -o Dir::Etc::SourceList=/usr/local/aegis/globalcfg/apt/aegis.list
  12. root@iZ8vb4poq26tme4bwexb4lZ:~# kill 25390
  13. root@iZ8vb4poq26tme4bwexb4lZ:~# ps afx | grep apt
  14. 30567 pts/1 S+ 0:00 | | \_ grep --color=auto apt
  15. root@iZ8vb4poq26tme4bwexb4lZ:~#

执行安装命令:

  1. apt-get install lrzsz

报错,错误信息如下:

  1. E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.

删除文件之前,尽量备份删除的文件:

  1. sudo rm /var/lib/dpkg/updates/* sudo apt-get update sudo apt-get upgrade

开始安装:

  1. apt-get install lrzsz

在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,107人围观)

还没有评论,来说两句吧...

相关阅读