I copied a working raspbian buster installation from one SD card to another (raspberry pi 4). I did so by simply calling dd if=/dev/mmcblk0 of=raspbian bs=1M
on my Notebook with the existing SD card plugged in. I then did the opposite to copy the image to the new SD card by doing dd if=raspbian of=/dev/mmcblk0 bs=1M
. The system boots fine and expanding the root partition worked perfectly.
However, for some reason, I cannot run apt-get update
when using the new SD card. This is what apt-get
reports:
Get:1 http://archive.raspberrypi.org/debian buster InRelease [25.2 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Err:1 http://archive.raspberrypi.org/debian buster InRelease
Unknown error executing apt-key
Err:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Unknown error executing apt-key
Fetched 40.2 kB in 1s (49.8 kB/s)
Reading package lists... Done
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.org/debian buster InRelease: Unknown error executing apt-key
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.org/raspbian buster InRelease: Unknown error executing apt-key
W: Failed to fetch http://raspbian.raspberrypi.org/raspbian/dists/buster/InRelease Unknown error executing apt-key
W: Failed to fetch http://archive.raspberrypi.org/debian/dists/buster/InRelease Unknown error executing apt-key
W: Some index files failed to download. They have been ignored, or old ones used instead.
I tried lots of different things to resolve the issue, but google only shows potential solutions for corrupted gpg key databases. None of those worked and I have the feeling that it's something else.
Do I have to do anything special after creating a copy like that?
Update with info from comment:
apt-get
works fine with the previous card. For testing, I copied the image onto the old card, which broke apt-get
as well then. So I guess the image is broken in some way?
Update:
As I broke the existing SD card with further testing, no amount of dd magic will fix the issue now, I'm afraid. So I need to find a way to fix the issue apt-get
and apt-key
are having. Resetting the sources did not help.
apt-get
? – M. Rostami Jan 07 '20 at 22:29