Home > Interesting > Error – “The repository is not signed”

Error – “The repository is not signed”

Problem:
I was trying to install a private repository on a machine, but I kept on getting the error that the repository I was trying to add was not signed. This despite the fact that I had added the public key to the machine.

It turned out that I was adding the key to the wrong place, or in the wrong way and apt update was not able to find it.

Following the steps in the article listed in the source sorted out the issue for me.

Solution:
1. Export the public key (from the private repo machine, if you haven’t published it to a keyserver.

$ sudo gpg --export --armor 4AUQUEOFY6YPU > public.key

2. Copy the public.key to the new machine, then add the key

$ less public.key | gpg --dearmor | sudo tee /usr/share/keyrings/myrepo.gpg

3. Add the private repository to your sources list

$ echo "deb [signed-by=/usr/share/keyrings/myrepo.gpg arch=amd64] http://192.168.33.10:8080/ jammy main"| sudo tee /etc/apt/sources.list.d/myrepo.list

4. Update now works without any errors

$ sudo apt update

Source
Handling “apt-key is deprecated. Manage keyring files in trusted.gpg.d instead” in Ubuntu Linux

Categories: Interesting
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.