首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何解决这个问题:“等待缓存锁:无法获得锁/var/lib/dpkg/锁前端。它由进程3321 (apt)持有。

如何解决这个问题:“等待缓存锁:无法获得锁/var/lib/dpkg/锁前端。它由进程3321 (apt)持有。
EN

Ask Ubuntu用户
提问于 2022-11-01 08:37:19
回答 1查看 7.8K关注 0票数 4

我试过这个:

代码语言:javascript
复制
moncef@moncef-Latitude-E7270:~$ sudo apt install tor
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)
Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 3321 (apt)... 5s

这是我的指挥记录:

代码语言:javascript
复制
  109  sudo apt install ubuntu-restricted-extras
  110  sudo snap install qbittorrent-arnatious
  111  exit
  112  shutdown -h now
  113  systemctl poweroff -i
  114  sudo
  115  sudo apt install nmap
  116  sudo dpkg --configure -a
  117  sudo apt install nmap
  118  nmap
  119  history
  120  sudo apt remove ubuntu-restricted-extras
  121  sudo apt-get remove ubuntu-restricted-extras
  122  sudo apt remove ubuntu-restricted-extras
  123  sudo apt install tor
  124  sudo apt-get install tor
  125  sudo dpkg --configure -a
  126  ps aux | grep -i apt
  127  shutdown -h now
  128  sudo apt install ubuntu-restricted-extras
  129  sudo apt install tor
  130  history
  131  sudo apt install ubuntu-restricted-extras
  132  history
EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2022-11-01 10:13:59

在您的系统上有另一个apt实例运行PID (在本例中) 3321。如果您真的很着急,可以使用以下命令等待它完成,或者杀死它:

代码语言:javascript
复制
sudo kill 3321

如果它不起作用,那么运行以下命令:

代码语言:javascript
复制
sudo kill -9 3321

使用任何PID给出的错误,而不是3321。

票数 3
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1438501

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档