So I Broke The Pi
- 3 minutes read - 510 wordsLike a lot of people, I used raspctl.com to do dynamic DNS for my house. This is so that I could SSH into my Pi from work. Unfortunately raspctl.com has now shut down (which is why I’m not linking to it).
When I installed it, I followed the instructions. Those instructions included
adding a repository to apt, so that I could keep the raspctl dynamic DNS client
up to date, along with everything else, with the usual apt-get command. And,
when time came to move off the service, I could use apt-remove to remove the
client. Which I duly did.
Unfortunately, the key for that repo expired. This caused the apt-get update
command to fail:
Fetched 490 B in 16s (29 B/s)
Reading package lists... Done
W: GPG error: http://debrepo.krenel.org raspctl Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A723006C1A8FD9D6`So I checked to see what was wrong, and found out how to check expired keys:
sudo apt-key list | grep expired
pub 2048R/1A8FD9D6 2013-03-16 [expired: 2017-03-15]“Aha!” I thought. “That’s the badger, I’ll just update it!”
% sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 1A8FD9D6This did not work, because no updated key was available.
Eventually, it dawned on me that I was trying to renew a key for a service that was shutting down. So I stopped trying to do that. Instead, I went for DuckDNS, which was the replacement that the raspctl.com person recommends. That set-up went easily, and for a while I had two domain names.
Unfortunately, the apt-get command still didn’t work, and I clearly
needed to fix the repo. But how?
It seems I’d missed a trick earlier. I’d done apt-key list earlier, but I’d
piped it through grep, which had told me which key had expired, but stripped
the rest of the detail. Without the grep command, you get this:
pi@mauvedeitypi ~/keys % sudo apt-key list
/etc/apt/trusted.gpg
--------------------
pub 2048R/90FDDD2E 2012-04-01
uid Mike Thompson (Raspberry Pi Debian armhf ARMv6+VFP)
sub 2048R/5373DC6C 2012-04-01
pub 2048R/7FA3303E 2012-06-17
uid Raspberry Pi Archive Signing Key
sub 2048R/EDD83D6C 2012-06-17
pub 4096R/0C50B1C5 2013-05-11
uid Collabora Raspbian Archive Signing Key
sub 4096R/D107BAE1 2013-05-11
pub 2048R/7BD9BF62 2011-08-19 [expires: 2024-06-14]
uid nginx signing key
pub 2048R/1A8FD9D6 2013-03-16 [expired: 2017-03-15]
uid [redacted] <[redacted]@krenel.org>This clearly shows that krenel.org is the problem — this is the key that won’t
renew, and this is also the source for the original raspctl dynamic DNS client.
Since that service is going away, and I’m not using it any more, I should blow
it away. But how to remove a repository?
It turns out that on raspbian, adding a repo causes the system to add an entry
in a folder called sources.list.d. So, to nuke the broken repo:
cd /etc/apt/sources.list.d
sudo rm krenel.listAfter that, my apt-get update command (and friends) work again.
Documented in the hope that this is useful to someone else — if it helps you, please leave a comment!
Edited 08/04/2017 to add more detail of the failure, fix typos, and so on.