Hi all, I’m trying to get autofocus working on my Arducam setup and following the docs to install the libcamera_dev package. The installer script keeps dying with a dpkg error about python3-libcamera trying to overwrite files that also belong to libcamera-dev. I’m on a Raspberry Pi running Bullseye. The error mentions ‘/usr/lib/python3/dist-packages/libcamera/init.py’. Has anyone run into this?
Can you share a bit more about your environment? Specifically the hardware revision, kernel version, OS codename, and architecture. Also, what exact command are you running for the install?
Sure. Here’s what the installer reports:
Hardware Revision: c03115
Kernel Version: 5.15.84-v7l+
OS Codename: bullseye
ARCH: armv7l
Platform: Raspberry Pi (camerapi@raspberrypi)
The command I’m running is:
./install_pivariety_pkgs.sh -p libcamera_dev
One thing I noticed: it first removes some existing packages:
The following packages will be REMOVED: libcamera-apps libcamera0
Removing libcamera-apps (1.2.1-1) …
Removing libcamera0:armhf (0~git20230720+bde9b04f-1) …
Then it tries to install libcamera0 and python3-libcamera.
Thanks, that’s helpful. So it’s removing the existing libcamera0 and apps, then pulling in newer ones. From what you’ve shown, the libcamera0 unpack actually succeeds (0~git20230724+ad9428b4-1 replaces the older one). The failure is specific to python3-libcamera. Can you paste the full error block from the first failure, including any downgrade warning that appears after it?
Here’s the first failure:
dpkg: error processing archive /var/cache/apt/archives/python3-libcamera_0~git20230720+bde9b04f-1_armhf.deb (–unpack):
trying to overwrite ‘/usr/lib/python3/dist-packages/libcamera/init.py’, which is also in package libcamera-dev 0.0.12
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
E: Sub-process /usr/bin/dpkg returned an error code (1)
Right after that, it also complained about a downgrade:
The following packages will be DOWNGRADED: libcamera-dev
E: Packages were downgraded and -y was used without --allow-downgrades.
Two separate problems there. The downgrade one is because the script passes -y but libcamera-dev would be going backwards, so apt refuses. The overwrite error is the real blocker though - libcamera-dev 0.0.12 is already sitting on that init.py path, and python3-libcamera wants to place its own file there. Did the script re-try on its own after that? It looks like it may have attempted again with a bigger package list. Can you run it again and capture everything until it stops?
Yes, it re-tried with a bunch more packages:
freeglut3, libdrm-omap1, libkms++0, libturbojpeg0, python3-kms++, python3-libcamera, python3-opengl, python3-picamera2, python3-pidng, python3-piexif, python3-prctl, python3-simplejpeg, python3-v4l2
But it fails the same way on the retry:
dpkg: error processing archive /tmp/apt-dpkg-install-Gam9Bg/05-python3-libcamera_0~git20230720+bde9b04f-1_armhf.deb (–unpack):
trying to overwrite ‘/usr/lib/python3/dist-packages/libcamera/init.py’, which is also in package libcamera-dev 0.0.12
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing: /tmp/apt-dpkg-install-Gam9Bg/05-python3-libcamera_0~git20230720+bde9b04f-1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
At the end it just says:
Unknown error, please send the error message to [email protected]
Thanks for the full log - that confirms the root cause. The script is downloading its packages from the ArduCAM GitHub releases (libcamera-v0.0.5 tag), including libcamera0_0_git20230724+ad9428b4-1_armhf.deb and libcamera-dev_0_git20230724+ad9428b4-1_armhf.deb. The problem is the system still has libcamera-dev 0.0.12 installed, and python3-libcamera tries to write /usr/lib/python3/dist-packages/libcamera/init.py over it - dpkg refuses and aborts.
The fact that you’re on kernel 5.15.84-v7l+ is the bigger issue. This package set expects the supported Bullseye image with kernel 6.1.21. On the older kernel you get this libcamera-dev file overwrite conflict plus the downgrade error you saw.
Recommendation: flash the Bullseye OS with kernel version 6.1.21 onto the Pi, then run the installer again. That should avoid the libcamera-dev conflict and the downgrade problem. If flashing a full image isn’t feasible, at least updating the kernel to 6.1.21 is the thing to try.