Libcamera install script fails and IMX519 camera blurry on Raspberry Pi Bullseye

Hi everyone. I’m hitting an error while installing libcamera for my 16MP IMX519 camera using Arducam’s script:

./install_pivariety_pkgs.sh -p libcamera

The script ends with ‘Unknown error, please send the error message to [email protected]’. The camera also has a focus problem - everything comes out blurry, so the focus looks misaligned.

Environment:
Hardware Revision: a32082
Kernel Version: 6.1.21-v8+
OS Codename: bullseye
ARCH: aarch64

Here’s the relevant output:
E: Unable to locate package python3-libcamera
E: Unable to locate package python3-picamera2
W: Target Packages (main/binary-arm64/Packages) is configured multiple times in /etc/apt/sources.list.d/libcamera.list:1 and /etc/apt/sources.list.d/raspi.list:1
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list.d/libcamera.list:1 and /etc/apt/sources.list.d/raspi.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/libcamera.list:1 and /etc/apt/sources.list.d/raspi.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list.d/libcamera.list:1 and /etc/apt/sources.list.d/raspi.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/libcamera.list:1 and /etc/apt/sources.list.d/raspi.list:1

The following packages will be REMOVED: libcamera-apps libcamera-dev libcamera0
0 upgraded, 0 newly installed, 3 to remove and 4 not upgraded.
Note, selecting ‘libcamera0’ instead of ‘./libcamera0_0_git20230724+ad9428b4-1_arm64.deb’
Note, selecting ‘libcamera-dev’ instead of ‘./libcamera-dev_0_git20230724+ad9428b4-1_arm64.deb’
Downloaded libcamera0_0_git20230724+ad9428b4-1_arm64.deb (694516 bytes) and libcamera-dev_0_git20230724+ad9428b4-1_arm64.deb (24384 bytes) from github.com releases

I’ve already tried a few things myself but haven’t managed to sort either the install error or the focus issue.

Thanks for the full log, that helps. The main problem is that the -p libcamera option is the generic path, so it’s trying to install python3-libcamera and python3-picamera2 from apt, and those packages can’t be located in your current sources. The duplicate-target warnings are just apt noticing that /etc/apt/sources.list.d/libcamera.list and /etc/apt/sources.list.d/raspi.list both define the same main targets.

For the IMX519 you should use Arducam’s custom libcamera packages instead. Run these two:
./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps

Then verify the autofocus with:
libcamera-still -t 0

That will show whether the IMX519 autofocus is working normally.

Quick update. I ran the two package options you suggested and the focus issue on the 16MP IMX519 is now resolved - autofocus looks normal.

One thing is still bugging me though: when I run the installation command it still shows a persistent error/warning in the output (I’ve attached the screenshots). The system seems to continue working normally despite that message. Could there be any hidden issue or should I do anything else to make sure the system stays stable?

Commands I used:
./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps
libcamera-still -t 0

Glad the focus is sorted. The warning you’re seeing is part of the installation output, but it doesn’t indicate a failure as long as the Arducam custom libcamera packages installed successfully. Since autofocus is working normally with libcamera-still -t 0, that’s the confirmation the custom libcamera install succeeded.

No further action is needed regarding that warning. It can be ignored and the system should remain stable as expected.