charmbracelet / gum

A tool for glamorous shell scripts 🎀
MIT License
17.33k stars 330 forks source link

GPG Public Key Signature Failure Causes Gum Install To Fail #377

Open ideonrandy opened 1 year ago

ideonrandy commented 1 year ago

Describe the bug On particular Ubuntu machines, the installation steps to install gum through the apt package manager do not succeed due to a GPG error: W: GPG error: https://repo.charm.sh/apt InRelease: The following signatures couldn't be verified because the public key is not available.

To Reproduce Steps to reproduce the behavior:

sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update && sudo apt install gum

Expected behavior A clear and concise description of what you expected to happen.

Screenshots image

IOT GATEWAY 8:

Additional context I had run the commands as both a regular and root user and the issue persisted. On that same machine, I created a base ubuntu container and ran the following steps to try and reproduce the problem but in this case the install succeeded without issue:

apt-get update
apt-get install -y sudo curl gpg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update && sudo apt install gum
ideonrandy commented 1 year ago

Here is a simple bypass - replace:

sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update && sudo apt install gum

With:

echo 'deb [trusted=yes] https://repo.charm.sh/apt/ /' | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update && sudo apt install gum
sudo rm /etc/apt/sources.list.d/charm.list && sudo apt update

It does not solve the underlying key issue, but it allows for Gum to be installed by bypassing the key and then removes the package source so that the warning doesn't constantly show up afterwards

aymanbagabas commented 1 year ago

Hi @ideonrandy, make sure you have gnupg and curl installed

hanbyul-kim commented 1 year ago

I installed ca-certificates and finally could install gum.

sudo apt install ca-certificates