2014年2月6日 星期四

[Coding] 解决 gpg: Can't check signature: public key not found

是否遇過才想要把source tree抓下來,在repo init的時候就遇到了錯誤,如下:

ryan@ryan-laptop:~/android_jb$ repo init -u https://github.com/AOSP_Demo/manifest -b kitkat-dev
gpg: keyring `/home/ryan/.repoconfig/gnupg/secring.gpg' created
gpg: keyring `/home/ryan/.repoconfig/gnupg/pubring.gpg' created
gpg: /home/ryan/.repoconfig/gnupg/trustdb.gpg: trustdb created
gpg: key 920F5C65: public key "Repo Maintainer " imported
gpg: key 338871A4: public key "Conley Owens " imported
gpg: Total number processed: 2
gpg:               imported: 2  (RSA: 1)

*Generated Tags Here*

object e76efdd7b342577c40aa271fa5ded9d66a783a9b
type commit
tag v1.12.4
tagger Conley Owens  1380645867 -0700

repo 1.12.4

gpg: Signature made Tue 01 Oct 2013 12:44:27 PM EDT using RSA key ID 692B382C
gpg: Can't check signature: public key not found
error: could not verify the tag 'v1.12.4'

原因也很簡單,其實就是repo的版本太舊了;只需要執行以下的command就可以解決了。

// 確保你在home目錄下有bin這個資料夾
$ mkdir ~/bin
$ PATH=~/bin:$PATH

// 下載新的repo到bin目錄下
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

以上參考自: https://source.android.com/source/downloading.html
張貼留言