debian用apt-get install安装时报错Could not get lock /var/lib/dpkg/lock

这是我在安装apache时遇到的问题,敲apt-get install apache2,就报错下面的内容

root@fff:~# apt-get install apache2
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?

E:无法获得锁/ var / lib / dpkg / lock-frontend-打开(11:资源暂时不可用)
E:无法获取dpkg前端锁(/ var / lib / dpkg / lock-frontend),是否正在使用另一个进程?

用rm命令删除

rm /var/cache/apt/archives/lock

rm /var/lib/dpkg/lock

经测试,这两条命令下去了,再安装,还是报错

root@fff:~# rm /var/cache/apt/archives/lock
root@fff:~# rm /var/lib/dpkg/lock
root@fff:~# apt-get install apache2      安装了报错
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?
root@fff:~# rm /var/lib/dpkg/lock-frontend      然后又来一道命令

root@fff:~# apt-get install apache2               再安装
E: dpkg was interrupted, you must manually run ‘dpkg –configure -a’ to correct the problem.
root@fff:~# dpkg –configure -a       这次可以了
root@fff:~# apt-get install apache2    成功
Reading package lists… Done
Building dependency tree
Reading state information… Done
apache2 is already the newest version (2.4.25-3+deb9u9).
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y

以上只是个人实测的一个笔记

上一篇 openvpn客户端证书路由详解修改路由并提速分流访问
下一篇 telegram电脑端和手机端如何快速的更改为中文语言

投稿邮箱:
ivpsr888@gmail.com (投稿详情)

TG订阅频道:
t.me/ivpsr_news 网站最新内容推送

TG交流群:
(点击加入) 用户交流

文章列表
1
win10/7系统使用新版v2rayN6.2的教程详细篇
win10/7系统使用新版v2rayN6.2的教程详细篇
2
HostDare美国VPS,$19.5/年,单核/1.5GB内存/10GB NVMe/1TB流量/1Gbps带宽/洛杉矶机房,可选CN2 GIA线路
HostDare美国VPS,$19.5/年,单核/1.5GB内存/10GB NVMe/1TB流量/1Gbps带宽/洛杉矶机房,可选CN2 GIA线路
3
HostDare:美国VPS 亚洲优化 9折年付/两年付/三年付 循环优惠码
HostDare:美国VPS 亚洲优化 9折年付/两年付/三年付 循环优惠码
4
911宣布关停后有没有好的独享ip
911宣布关停后有没有好的独享ip
5
Collaboro选择Macquarie云托管数据
Collaboro选择Macquarie云托管数据
6
欧路云:#三周年庆#,全场6折优惠,CN2 GIA/9929/200Gbps防御,充值优惠
欧路云:#三周年庆#,全场6折优惠,CN2 GIA/9929/200Gbps防御,充值优惠
7
解决 Let’s Encrypt SSL 证书申请的 403 错误:完整的 Nginx 配置和排错教程
解决 Let’s Encrypt SSL 证书申请的 403 错误:完整的 Nginx 配置和排错教程
8
cloudcone:美国云服务器,winserver2016/2019授权版,$17.49,4G内存/3核/60gSSD/3T流量/1Gbps带宽
cloudcone:美国云服务器,winserver2016/2019授权版,$17.49,4G内存/3核/60gSSD/3T流量/1Gbps带宽
9
RAKsmart:8月惊爆促销,爆款产品 $ 30秒杀,香港新增DDOS最高100G,爆款VPS仅 $ 1.99
RAKsmart:8月惊爆促销,爆款产品 $ 30秒杀,香港新增DDOS最高100G,爆款VPS仅 $ 1.99
10
locvps全球云:德国VPS深度测评[2023],BGP优化线路,locvps好不好?看测评反馈结果
locvps全球云:德国VPS深度测评[2023],BGP优化线路,locvps好不好?看测评反馈结果