For a project I am working on, I am running a (homebrew) "container" sort of setup - using systemd-nspawn on a mounted RaspiOS Bookworm image. Here's my script:
This gets me a shell running in the chroot environment and most things works as expected.
Now, I want to install something in the chroot. So, from the shell, I do "sudo bash", then "apt-get update". Most of it seems OK, but there are errors:
The above is with stock, unmodified /etc/apt/sources.list file.
Then when I do: apt-get install ffmpeg
somethings work; but most things don't. The error is like:
I'm guessing that when you do a real install (to an SD card) of the image, the signature/etc stuff gets updated so that this will work. Is it possible to do that manually in the chroot?
An alternative would be for me to go ahead and install to an SD card, and then use that SD card as the image for the chroot, but obviously, that's not the easiest solution.
Finally, note that this general idea is based on Botspot's "vdesktop" concept, but there are reasons why I'd rather not use vdesktop directly. I included Botspot in the thread subject, just in case he has anything to contribute here.
Code:
loopdev=$(losetup -fP --show 2024-10-22-raspios-bookworm-armhf-lite.img)mount ${loopdev}p2 /mnt/Chrootsystemd-nspawn -D /mnt/Chroot -a -u pi --chdir=/home/pi --bind=/home/pi/binumount /mnt/Chrootlosetup -d $loopdev
Now, I want to install something in the chroot. So, from the shell, I do "sudo bash", then "apt-get update". Most of it seems OK, but there are errors:
Code:
root@Chroot:/home/pi# apt-get updateGet:1 http://archive.raspberrypi.com/debian bookworm InRelease [39.3 kB]Get:2 http://raspbian.raspberrypi.com/raspbian bookworm InRelease [15.0 kB]Err:1 http://archive.raspberrypi.com/debian bookworm InRelease At least one invalid signature was encountered.Err:2 http://raspbian.raspberrypi.com/raspbian bookworm InRelease At least one invalid signature was encountered.Fetched 54.3 kB in 2s (28.3 kB/s)Reading package lists... DoneW: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.raspberrypi.com/debian bookworm InRelease: At least one invalid signature was encountered.W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://raspbian.raspberrypi.com/raspbian bookworm InRelease: At least one invalid signature was encountered.W: Failed to fetch http://raspbian.raspberrypi.com/raspbian/dists/bookworm/InRelease At least one invalid signature was encountered.W: Failed to fetch http://archive.raspberrypi.com/debian/dists/bookworm/InRelease At least one invalid signature was encountered.W: Some index files failed to download. They have been ignored, or old ones used instead.root@Chroot:/home/pi#
Then when I do: apt-get install ffmpeg
somethings work; but most things don't. The error is like:
Code:
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.raspberrypi.com/debian bookworm InRelease: At least one invalid signature was encountered.W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://raspbian.raspberrypi.com/raspbian bookworm InRelease: At least one invalid signature was encountered.
An alternative would be for me to go ahead and install to an SD card, and then use that SD card as the image for the chroot, but obviously, that's not the easiest solution.
Finally, note that this general idea is based on Botspot's "vdesktop" concept, but there are reasons why I'd rather not use vdesktop directly. I included Botspot in the thread subject, just in case he has anything to contribute here.
Statistics: Posted by BigRedMailbox — Wed Dec 18, 2024 11:15 am — Replies 0 — Views 25