E: could not get lock /var/lib/dpkg/lock-frontend - open

E: could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporary unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is an other process using it

源程序:
import numpy as np
import cv2
import matplotlib.pyplot as plt

img1=cv2.imread(‘1.png’,cv2.IMREAD_UNCHANGED)#queryImage
img2=cv2.imread(‘2.png’,cv2.IMREAD_UNCHANGED)#trainImage

#Initiate SIFT detector
orb=cv2.ORB_create()

#find the keypoints and descriptors with SIFT
kp1,des1=orb.detectAndCompute(img1,None)
kp2,des2=orb.detectAndCompute(img2,None)

#create BFMatcher object
bf=cv2.BFMatcher(cv2.NORM_HAMMING,crossCheck=True)

#Match descriptors.
matches=bf.match(des1,des2)

#Sort them in the order of their distance.
matches=sorted(matches,key=lambda x:x.distance)

#Draw first 10 matches.
img3=cv2.drawMatches(img1,kp1,img2,kp2,matches[:60],outImg=1,flags=2)

plt.imshow(img3)
plt.show()

运行结果:
E: could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporary unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is an other process using it

解决方案:

1) 首先查看是否有apt-get这个程序在运行

ps aux|grep apt-get

2) 如果发现存在这样的程序在运行那么就kill掉,否则执行3)

3 )直接删除锁文件

sudo rm /var/lib/dpkg/lock-frontend

sudo rm /var/lib/dpkg/lock

修改后运行结果

图像显示

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值