键入后sudo apt-get install droidcam
我收到错误:-
Setting up droidcam (1.3-0ubuntu0) ...
tar: *.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
dpkg: error processing package droidcam (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
droidcam
E: Sub-process /usr/bin/dpkg returned an error code (1)
输出sudo apt-cache policy droidcam
droidcam:
Installed: 1.3-0ubuntu0
Candidate: 1.3-0ubuntu0
Version table:
*** 1.3-0ubuntu0 0
500 http://ppa.launchpad.net/paolorotolo/droidcam/ubuntu/ trusty/main amd64 Packages
100 /var/lib/dpkg/status
如何解决这个问题?
答案1
实际上,您提到的错误是第一次安装尝试后的第二种状态。
- 第一次尝试以 make/编译错误结束并删除模块源档案(没有检查构建是否成功)。
- 下一次试验显示缺少内核模块源档案。
这是原始错误(完整日志):
make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory '/usr/src/linux-headers-3.19.0-30-generic'
LD /opt/droidcam/v4l2loopback/built-in.o
CC [M] /opt/droidcam/v4l2loopback/v4l2loopback-dc.o
/opt/droidcam/v4l2loopback/v4l2loopback-dc.c: In function ‘attr_store_maxopeners’:
/opt/droidcam/v4l2loopback/v4l2loopback-dc.c:456:3: error: implicit declaration of function ‘strict_strtoul’ [-Werror=implicit-function-declaration]
if (strict_strtoul(buf, 0, &curr))
^
/opt/droidcam/v4l2loopback/v4l2loopback-dc.c: At top level:
/opt/droidcam/v4l2loopback/v4l2loopback-dc.c:2311:3: warning: initialization from incompatible pointer type
.vidioc_s_std = &vidioc_s_std,
^
/opt/droidcam/v4l2loopback/v4l2loopback-dc.c:2311:3: warning: (near initialization for ‘v4l2_loopback_ioctl_ops.vidioc_s_std’)
/opt/droidcam/v4l2loopback/v4l2loopback-dc.c:2331:3: warning: initialization from incompatible pointer type
.vidioc_s_audio = &vidioc_s_audio,
^
/opt/droidcam/v4l2loopback/v4l2loopback-dc.c:2331:3: warning: (near initialization for ‘v4l2_loopback_ioctl_ops.vidioc_s_audio’)
/opt/droidcam/v4l2loopback/v4l2loopback-dc.c:2333:3: warning: initialization from incompatible pointer type
.vidioc_s_audout = &vidioc_s_audout,
^
/opt/droidcam/v4l2loopback/v4l2loopback-dc.c:2333:3: warning: (near initialization for ‘v4l2_loopback_ioctl_ops.vidioc_s_audout’)
cc1: some warnings being treated as errors
scripts/Makefile.build:263: recipe for target '/opt/droidcam/v4l2loopback/v4l2loopback-dc.o' failed
make[2]: *** [/opt/droidcam/v4l2loopback/v4l2loopback-dc.o] Error 1
Makefile:1395: recipe for target '_module_/opt/droidcam/v4l2loopback' failed
make[1]: *** [_module_/opt/droidcam/v4l2loopback] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-3.19.0-30-generic'
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2
为了修复原始错误,strict_strtoul
被替换为kstrtoul
获取源代码
sudo apt-add-repository -s ppa:paolorotolo/droidcam sudo apt-get update mkdir sand_box cd sand_box apt-get source droidcam cd droidcam-*/
安装构建依赖项
sudo apt-get builddep droiddeb sudo apt-get install devscripts debhelper
替换
strict_strtoul
为kstrtoul
:- droidcam-v4l2-x64.tar.gz:/v4l2loopback/v4l2loopback-dc.c
- droidcam-v4l2-x86.tar.gz:/v4l2loopback/v4l2loopback-dc.c
构建和安装
debbuild -d -uc sudo dpkg -i ../droidcam_*.deb
另一种方法,无需重建 Debian 软件包:
尝试安装后,如果出现错误,请运行:
sudo apt-get install droidcam
转到
/var/cache/apt/archives/
。使用存档管理器打开其包并提取两个droidcam-v4l2-*.tar.gz
文件(或只需要 arch)替换
strict_strtoul
为kstrtoul
:- droidcam-v4l2-x64.tar.gz:/v4l2loopback/v4l2loopback-dc.c
- droidcam-v4l2-x86.tar.gz:/v4l2loopback/v4l2loopback-dc.c
将两个档案移至 /opt/droidcam/
sudo mv droidcam-v4l2-*.tar.gz /opt/droidcam/
再次运行安装以重建它
sudo apt-get install droidcam
参考: