type -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
Created
January 5, 2023 18:09
-
-
Save tst32/9a188d39ce250dfbf45fd827d0512b3b to your computer and use it in GitHub Desktop.
how to resolve: public key is not available: NO_PUBKEY 23F3D4EA75716059 (microsoft way)
there are two ways to replace the use of the obsolete apt-key in a new way
The first way is to put the desired "NO_PUBKEY" and put it in the trusted by apt service gpg repository.
/etc/apt/trusted.gpg.d/
this is a common way for installers scripts
Another way which I have shown in the examples above is to specify the desired gpg file as a valid signature in the repo source file. This requires first downloading the gpg file and then converting it to the desired by apt format and saving it to a convenient location - usually either in your home directory or in /usr/share/keyrings/<name.gpg>
and then add it to the source.list file
.i.e.
# ищем NO_PUBKEY
gpg --no-default-keyring --keyring protonvpn.gpg --keyserver keyserver.ubuntu.com --recv-keys 4EDE055B645F044F
# экспорт в нужный для APT формат
gpg --no-default-keyring --keyring $HOME/.gnupg/protonvpn.gpg --export > ./archive-protonvpn.gpg
# копируем в удобное место
cp ./archive-protonvpn.gpg /usr/share/keyrings/
sudo chmod 644 /usr/share/keyrings/archive-protonvpn.gpg
# открывам nano/vi/gedit
nano /etc/apt/sources.list.d/protonvpn-stable.list
# добавляем
deb [arch="all" signed-by=/usr/share/keyrings/archive-protonvpn.gpg] https://repo.protonvpn.com/debian stable main
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.