Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When performing apt-get update, I get the following error:

root@ADS3-Debian6:/home/aluno# apt-get update
Atingido http://sft.if.usp.br squeeze Release.gpg
Ign http://sft.if.usp.br/debian/ squeeze/contrib Translation-en
Ign http://sft.if.usp.br/debian/ squeeze/contrib Translation-pt
Ign http://sft.if.usp.br/debian/ squeeze/contrib Translation-pt_BR

(...)

Obter:10 http://security.debian.org squeeze/updates/non-free i386 Packages [14 B]
Baixados 612 kB em 4s (125 kB/s)                    
Lendo listas de pacotes... Pronto
There is no public key available for the following key IDs: 8B48AD6246925553
share|improve this question
2  
... and that string you elided is an important bit. It'd let us identify which keys you're missing (assuming installing the keyring packages—preferably from trusted media—that ruda suggested doesn't help) – derobert May 14 '13 at 17:43
up vote 44 down vote accepted

the other answers will work, or not, depending on whether or not the key '8B48AD6246925553' is present in the packages they indicate.

if you need a key, you have to get that key, and where to find it, it's in a key server (very probably any key server will do):

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553

share|improve this answer
3  
This should be the accepted answer. – starbeamrainbowlabs Sep 4 '15 at 16:16
    
This worked for me too and not other answers here.. – Sai Kiran Apr 28 at 4:54

I recommend that you follow @mariotomo's answer rather than the steps below:


According to There is no public key available for the following key ID, this will fix it:

sudo aptitude install debian-keyring debian-archive-keyring

References

share|improve this answer
    
The last 8 hex digits are shared with this, so it's probably complaining about wheezy. Unfortunate of the OP to have elided that: pub 4096R/46925553 2012-04-27 [expires: 2020-04-25] uid Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org> – user18096 Jun 2 '13 at 0:56
4  
Is debian-keyring really needed? It worked out for me with just debian-archive-keyring. – x-yuri Oct 5 '15 at 15:24
    
Not surprisingly, different hex numbers may require different solutions. I put quotation marks around the number in my Google search, to force a verbatim search for that number, and I landed at this page, which fixed my problem: reddit.com/r/linux4noobs/comments/4grdo7/… (@mariotomo's answer may have worked too—I didn't try) – Michael Scheper Apr 30 at 13:29

I recommend

$ sudo apt-get install debian-archive-keyring
$ sudo apt-key update

This is better than other approaches because it does not install "debian-keyring", which is big and 99% of the time unnecessary.

share|improve this answer
    
This was all I needed - worked great for me! – harperville Nov 20 '15 at 19:53

The error There is no public key available for the following key IDs indicates a serious security issue: an operating-system package cannot be checked for integrity with its public key, because its public key is missing.

If the message were:

There is no public key available for the following key IDs: 1397BC53640DB551

You can use this command to find out which repository uses the key:

for n in `ls /var/lib/apt/lists/*gpg`; do echo "$n" ; gpg --list-packets "$n" | grep 1397BC53640DB551; done

Which in this example is the Google's repository for Chrome:

/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_Release.gpg

If you trust Google, its government, etc., you should find out where the key is and add it with:

wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
share|improve this answer
    
Fixed for me :) Thank you! But just curious, what was wrong? What does the first command do, and what does the second one do? Should this solve all problems? My issue was also with Google Chrome. – Rohan yesterday
    
And does the first command change anything with gpg? It says it created some conf file gpg.conf, and I do not know if I want that. – Rohan yesterday

As an alternative:

$ sudo apt-get install debian-keyring debian-archive-keyring
$ sudo apt-key update
share|improve this answer
6  
Please don't advertise your blog in your answers. That's what your bio is for. – slm Dec 6 '14 at 2:58

My answer is a slight upgrade (IMHO, YMMV) on @mariotomo (who I upvoted) in the following bash scriptlet

  • also uses gpg
  • parameterizes more
  • (also uses a different keyserver, though in this case I suspect it makes little difference)

You can also comment-out the eval line for a "dry-run": the scriptlet will then only show you what it intends to do, without actually doing it. Just be sure to change the value of NO_PUBKEY every time you use this (you can also change KEYSERVER as desired):

NO_PUBKEY='1397BC53640DB551' # CHANGE TO THE VALUE CITED IN YOUR ERROR MESSAGE!
KEYSERVER='keys.gnupg.net'

NO_PUBKEY_LEN="${#NO_PUBKEY}"
echo "NO_PUBKEY_LEN='${NO_PUBKEY_LEN}'"     # for sanity or debugging
# note following works because bash arrays have 0-based indices
NO_PUBKEY_2ND_HALF_START=$(( NO_PUBKEY_LEN/2 ))
echo "NO_PUBKEY_2ND_HALF_START='${NO_PUBKEY_2ND_HALF_START}'" # ditto
NO_PUBKEY_2ND_HALF="${NO_PUBKEY:${NO_PUBKEY_2ND_HALF_START}}"
echo "NO_PUBKEY_2ND_HALF='${NO_PUBKEY_2ND_HALF}'"             # ditto

for CMD in \
  'date' \
  "gpg --keyserver ${KEYSERVER} --recv-keys ${NO_PUBKEY_2ND_HALF}" \
  'date' \
  "gpg -a --export ${NO_PUBKEY_2ND_HALF} | sudo apt-key add -" \
; do
  echo -e "${CMD}"
  eval "${CMD}"
done
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.