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

相关推荐
WoY20201 天前
opencv-python在ubuntu系统中缺少依赖
python·opencv·ubuntu
ICscholar1 天前
ExaDigiT/RAPS
linux·服务器·ubuntu·系统架构·运维开发
知识分享小能手1 天前
Ubuntu入门学习教程,从入门到精通, Ubuntu 22.04中的Shell编程详细知识点(含案例代码)(17)
linux·学习·ubuntu
EndingCoder1 天前
TypeScript 的基本类型:数字、字符串和布尔
linux·ubuntu·typescript
oMcLin1 天前
如何在Ubuntu 24.04上通过配置Nginx与Keepalived实现高可用负载均衡集群
nginx·ubuntu·负载均衡
EndingCoder1 天前
数组和元组:处理集合数据
linux·运维·前端·ubuntu·typescript
弓弧名家_玄真君1 天前
虚拟机里的ubuntu 系统 设置宿主机关机ip不变化
linux·运维·ubuntu
.小墨迹1 天前
cmake的add_definitions和target_compile_definitions使用
c++·学习·算法·ubuntu·机器学习
102400241 天前
ubuntu图形化桌面崩溃,无法进入ttl&grub,导出数据教程
linux·运维·ubuntu
小米里的大麦1 天前
Ubuntu 22.04 中安装 thefuck 与 tldr 工具
linux·运维·ubuntu