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)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 scriptsAnother 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.