ubuntu16 apt安装程序锁死解决

目录

[1.使用apt install安装程序有时会爆出dpkg/lock类故障](#1.使用apt install安装程序有时会爆出dpkg/lock类故障)

2.使用lsof命令查看占用锁的进程

[3.使用kill -9命令删除占用进程](#3.使用kill -9命令删除占用进程)

4.删除锁

[5. 配置生效](#5. 配置生效)


1.使用apt install安装程序有时会爆出dpkg/lock类故障

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?

book@www.100ask.org:/mnt/hgfs/99_github/TinyWebServer$

2.使用lsof命令查看占用锁的进程

book@www.100ask.org:/mnt/hgfs/99_github/TinyWebServer$ sudo lsof /var/lib/dpkg/lock

lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs

Output information may be incomplete.

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

unattende 2861 root 4uW REG 8,1 0 3025283 /var/lib/dpkg/lock

3.使用kill -9命令删除占用进程

book@www.100ask.org:/mnt/hgfs/99_github/TinyWebServer$ sudo kill -9 2861

4.删除锁

book@www.100ask.org:/mnt/hgfs/99_github/TinyWebServer$ sudo rm /var/lib/dpkg/lock

5. 配置生效

book@www.100ask.org:/mnt/hgfs/99_github/TinyWebServer$ sudo dpkg --configure -a

相关推荐
Tipriest_9 小时前
ubuntu创建和更换当前swap大小
linux·运维·ubuntu
WI8LbH78811 小时前
Ubuntu 部署Harbor
linux·运维·ubuntu
优雅格子衫12 小时前
TypeScript 类的基本使用小结
javascript·ubuntu·typescript
XIAOHEZIcode5 天前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
张飞飞飞飞飞18 天前
Tmux命令使用教程
linux·服务器·ubuntu
盼小辉丶18 天前
Ubuntu极速部署OpenClaw完全指南(本地模型+DeepSeek)
linux·ubuntu·openclaw
黑白园18 天前
【环境搭建】Ubuntu安装(一)
linux·ubuntu
Moshow郑锴18 天前
Ubuntu用SDKMAN轻松管理多个Java 版本
java·ubuntu·sdkman
error:(18 天前
Ubuntu 22.04 GNOME远程桌面配置问题排查与解决全流程
linux·运维·ubuntu
Java知识技术分享18 天前
在windows上使用wsl安装Ubuntu~linux系统
linux·人工智能·windows·ubuntu